From 60a59a67fefe7dacabded0bc72f892a59b734760 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 4 Jan 2017 14:23:41 -0500 Subject: Fixing deleting messages in permalink view (#4958) --- webapp/stores/post_store.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 4f213ce28..023e74e35 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -316,13 +316,18 @@ class PostStoreClass extends EventEmitter { } deletePost(post) { - const postInfo = this.postsInfo[post.channel_id]; + let postInfo = null; + if (this.currentFocusedPostId == null) { + postInfo = this.postsInfo[post.channel_id]; + } else { + postInfo = this.postsInfo[this.currentFocusedPostId]; + } if (!postInfo) { // the post that has been deleted is in a channel that we haven't seen so just ignore it return; } - const postList = this.postsInfo[post.channel_id].postList; + const postList = postInfo.postList; if (isPostListNull(postList)) { return; -- cgit v1.2.3-1-g7c22