diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-07-12 12:38:07 -0400 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-07-13 01:38:07 +0900 |
commit | 8395981d2b3a02e2b61458cd19872632a45c2849 (patch) | |
tree | 38d5f84561976d5bba1645311f1bbaad35ec7ef5 /webapp/actions | |
parent | d3506c9d69e25f67109ffaae4ebc32e79a61244d (diff) | |
download | chat-8395981d2b3a02e2b61458cd19872632a45c2849.tar.gz chat-8395981d2b3a02e2b61458cd19872632a45c2849.tar.bz2 chat-8395981d2b3a02e2b61458cd19872632a45c2849.zip |
Properly updated pinned/flagged posts on deletion (#6920)
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/post_actions.jsx | 6 | ||||
-rw-r--r-- | webapp/actions/websocket_actions.jsx | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/webapp/actions/post_actions.jsx b/webapp/actions/post_actions.jsx index f319d59e3..836d3e380 100644 --- a/webapp/actions/post_actions.jsx +++ b/webapp/actions/post_actions.jsx @@ -216,6 +216,12 @@ export function deletePost(channelId, post, success) { data: post }); + // Needed for search store + AppDispatcher.handleViewAction({ + type: Constants.ActionTypes.REMOVE_POST, + post + }); + const {focusedPostId} = getState().views.channel; const channel = getState().entities.channels.channels[post.channel_id]; if (post.id === focusedPostId && channel) { diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index 82c9df617..184013179 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. import $ from 'jquery'; +import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; import UserStore from 'stores/user_store.jsx'; import TeamStore from 'stores/team_store.jsx'; @@ -265,6 +266,12 @@ function handlePostEditEvent(msg) { function handlePostDeleteEvent(msg) { const post = JSON.parse(msg.data.post); dispatch({type: PostTypes.POST_DELETED, data: post}); + + // Needed for search store + AppDispatcher.handleViewAction({ + type: Constants.ActionTypes.POST_DELETED, + post + }); } async function handleTeamAddedEvent(msg) { |