fix: post summaries disappear upon scroll to the bottom

This commit is contained in:
adeel.tajamul
2022-03-03 11:54:29 +05:00
committed by Mehak Nasir
parent 4c09768f61
commit bb73bdb9df
2 changed files with 3 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ function PostsView({ showOwnPosts }) {
filters,
page: nextPage,
author: showOwnPosts ? authenticatedUser.username : null,
}));
}, postsListComponent));
}
};

View File

@@ -91,7 +91,7 @@ export function fetchThreads(courseId, {
author = null,
filters = {},
page = 1,
} = {}) {
} = {}, posts = []) {
const options = {
orderBy,
topicIds,
@@ -117,6 +117,7 @@ export function fetchThreads(courseId, {
try {
dispatch(fetchThreadsRequest({ courseId }));
const data = await getThreads(courseId, options);
data.results = [...posts, ...data.results];
const normalisedData = normaliseThreads(camelCaseObject(data));
dispatch(fetchThreadsSuccess({ ...normalisedData, page, author }));
} catch (error) {