mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix dismissing deleted root post that had comments on it
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user