mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 15:43:59 +08:00
Only add a post to the post stream once
This commit is contained in:
parent
4f0e620cff
commit
d5a3e3d2c6
|
@ -112,10 +112,13 @@ export default class PostStream {
|
|||
})
|
||||
}
|
||||
|
||||
// @todo rename to pushPost
|
||||
addPostToEnd(post) {
|
||||
var index = this.ids.length
|
||||
this.ids.push(post.id())
|
||||
this.content.push(this.makeItem(index, index, post))
|
||||
if (this.ids.indexOf(post.id()) === -1) {
|
||||
var index = this.ids.length;
|
||||
this.ids.push(post.id());
|
||||
this.content.push(this.makeItem(index, index, post));
|
||||
}
|
||||
}
|
||||
|
||||
removePost(id) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user