mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
Fix loadRange doesn't return all posts
This commit is contained in:
parent
d00c932ffc
commit
a8c52bc3df
|
@ -282,7 +282,13 @@ class PostStreamState {
|
|||
}
|
||||
});
|
||||
|
||||
return loadIds.length ? app.store.find('posts', loadIds) : Promise.resolve(loaded);
|
||||
if (loadIds.length) {
|
||||
return app.store.find('posts', loadIds).then((newPosts) => {
|
||||
return loaded.concat(newPosts).sort((a, b) => a.id() - b.id());
|
||||
});
|
||||
}
|
||||
|
||||
return Promise.resolve(loaded);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user