Properly updated pinned/flagged posts on deletion (#6920)

Этот коммит содержится в:
Joram Wilander
2017-07-12 12:38:07 -04:00
коммит произвёл Saturnino Abril
родитель d3506c9d69
Коммит 8395981d2b
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@@ -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) {

Просмотреть файл

@@ -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) {