Fix post in channel batching order (#4089)
This commit is contained in:
parent
00a05b1671
commit
e6099bcaf8
1 changed files with 4 additions and 4 deletions
|
|
@ -84,10 +84,6 @@ export function getPosts(channelId, page = 0, perPage = Posts.POST_CHUNK_SIZE) {
|
||||||
const posts = Object.values(data.posts);
|
const posts = Object.values(data.posts);
|
||||||
const actions = [];
|
const actions = [];
|
||||||
|
|
||||||
if (posts?.length || !postForChannel) {
|
|
||||||
actions.push(receivedPostsInChannel(data, channelId, page === 0, data.prev_post_id === ''));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (posts?.length) {
|
if (posts?.length) {
|
||||||
actions.push(receivedPosts(data));
|
actions.push(receivedPosts(data));
|
||||||
const additional = await dispatch(getPostsAdditionalDataBatch(posts));
|
const additional = await dispatch(getPostsAdditionalDataBatch(posts));
|
||||||
|
|
@ -96,6 +92,10 @@ export function getPosts(channelId, page = 0, perPage = Posts.POST_CHUNK_SIZE) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (posts?.length || !postForChannel) {
|
||||||
|
actions.push(receivedPostsInChannel(data, channelId, page === 0, data.prev_post_id === ''));
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(batchActions(actions));
|
dispatch(batchActions(actions));
|
||||||
|
|
||||||
return {data};
|
return {data};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue