mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 02:53:37 +08:00
Sort included posts
They can be out of order in the payload due to relationship loading, e.g. post #1 includes post #14 that has mentioned it, therefore #14 will be the first post in the payload. The new post stream doesn’t take kindly to out of order posts.
This commit is contained in:
parent
2e82fb4015
commit
456af4273b
|
@ -82,6 +82,7 @@ export default class DiscussionPage extends mixin(Component, evented) {
|
|||
includedPosts.push(app.store.getById('posts', record.id));
|
||||
}
|
||||
});
|
||||
includedPosts.sort((a, b) => a.id() - b.id());
|
||||
|
||||
this.stream = new PostStream({ discussion, includedPosts });
|
||||
this.stream.on('positionChanged', this.positionChanged.bind(this));
|
||||
|
|
Loading…
Reference in New Issue
Block a user