Fix dismissing deleted root post that had comments on it

This commit is contained in:
JoramWilander
2016-02-25 14:50:10 -05:00
parent 04f6b0b86c
commit 971e9f89da

View File

@@ -303,6 +303,20 @@ class PostStoreClass extends EventEmitter {
postList.order.splice(index, 1);
}
for (const pid in postList.posts) {
if (!postList.posts.hasOwnProperty(pid)) {
continue;
}
if (postList.posts[pid].root_id === post.id) {
Reflect.deleteProperty(postList.posts, pid);
const commentIndex = postList.order.indexOf(pid);
if (commentIndex !== -1) {
postList.order.splice(commentIndex, 1);
}
}
}
this.postsInfo[channelId].postList = postList;
}