diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-01-04 14:23:41 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-01-04 14:23:41 -0500 |
commit | 60a59a67fefe7dacabded0bc72f892a59b734760 (patch) | |
tree | 90d61fe10a132ad4692a72afadd661d16d8e4b7a | |
parent | bf9a8e4b1f1a0a13aaa0bb4c8d6dd8e533edba5d (diff) | |
download | chat-60a59a67fefe7dacabded0bc72f892a59b734760.tar.gz chat-60a59a67fefe7dacabded0bc72f892a59b734760.tar.bz2 chat-60a59a67fefe7dacabded0bc72f892a59b734760.zip |
Fixing deleting messages in permalink view (#4958)
-rw-r--r-- | webapp/stores/post_store.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
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; |