1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Remove posts from the post stream by ID

This commit is contained in:
Toby Zerner
2015-05-02 08:44:42 +09:30
parent 5fad4acd76
commit e9f0ef83b0
2 changed files with 4 additions and 4 deletions

View File

@@ -118,10 +118,10 @@ export default class PostStream {
this.content.push(this.makeItem(index, index, post))
}
removePost(post) {
this.ids.splice(this.ids.indexOf(post.id()), 1);
removePost(id) {
this.ids.splice(this.ids.indexOf(id), 1);
this.content.some((item, i) => {
if (item.post === post) {
if (item.post && item.post.id() === id) {
this.content.splice(i, 1);
return true;
}