forked from Ivasoft/mattermost-mobile
Fix post in channel batching order (#4089)
This commit is contained in:
@@ -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};
|
||||||
|
|||||||
Reference in New Issue
Block a user