fix: post summaries disappear upon scroll to the bottom
This commit is contained in:
committed by
Mehak Nasir
parent
4c09768f61
commit
bb73bdb9df
@@ -111,7 +111,7 @@ function PostsView({ showOwnPosts }) {
|
||||
filters,
|
||||
page: nextPage,
|
||||
author: showOwnPosts ? authenticatedUser.username : null,
|
||||
}));
|
||||
}, postsListComponent));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user