mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Properly updated pinned/flagged posts on deletion (#6920)
This commit is contained in:
committed by
Saturnino Abril
parent
d3506c9d69
commit
8395981d2b
@@ -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) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import * as PostUtils from 'utils/post_utils.jsx';
|
||||
|
||||
import Constants from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
import {Posts} from 'mattermost-redux/constants';
|
||||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
@@ -187,7 +186,7 @@ export default class SearchResultsItem extends React.Component {
|
||||
let message;
|
||||
let flagContent;
|
||||
let rhsControls;
|
||||
if (post.state === Posts.POST_DELETED) {
|
||||
if (post.state === Constants.POST_DELETED) {
|
||||
message = (
|
||||
<p>
|
||||
<FormattedMessage
|
||||
|
||||
Reference in New Issue
Block a user