From 1575488650f4d6df49820043af68e57489c66a46 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 27 Jan 2016 10:50:48 -0500 Subject: Clear deleted messages after channel leave and fix missig postlist error --- web/react/dispatcher/event_helpers.jsx | 3 ++- web/react/stores/post_store.jsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/react/dispatcher/event_helpers.jsx b/web/react/dispatcher/event_helpers.jsx index a03923c1a..5eb319320 100644 --- a/web/react/dispatcher/event_helpers.jsx +++ b/web/react/dispatcher/event_helpers.jsx @@ -19,7 +19,8 @@ export function emitChannelClickEvent(channel) { AppDispatcher.handleViewAction({ type: ActionTypes.CLICK_CHANNEL, name: channel.name, - id: channel.id + id: channel.id, + prev: ChannelStore.getCurrentId() }); } diff --git a/web/react/stores/post_store.jsx b/web/react/stores/post_store.jsx index 2212edadb..7abadf2b1 100644 --- a/web/react/stores/post_store.jsx +++ b/web/react/stores/post_store.jsx @@ -451,6 +451,8 @@ class PostStoreClass extends EventEmitter { post.filenames = []; posts[post.id] = post; + + this.makePostsInfo(post.channel_id); this.postsInfo[post.channel_id].deletedPosts = posts; } @@ -610,7 +612,7 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => { case ActionTypes.CLICK_CHANNEL: PostStore.clearFocusedPost(); PostStore.clearChannelVisibility(action.id, true); - PostStore.clearUnseenDeletedPosts(action.id); + PostStore.clearUnseenDeletedPosts(action.prev); break; case ActionTypes.CREATE_POST: PostStore.storePendingPost(action.post); -- cgit v1.2.3-1-g7c22