Properly updated pinned/flagged posts on deletion (#6920)
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
d3506c9d69
Коммит
8395981d2b
@@ -216,6 +216,12 @@ export function deletePost(channelId, post, success) {
|
|||||||
data: post
|
data: post
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Needed for search store
|
||||||
|
AppDispatcher.handleViewAction({
|
||||||
|
type: Constants.ActionTypes.REMOVE_POST,
|
||||||
|
post
|
||||||
|
});
|
||||||
|
|
||||||
const {focusedPostId} = getState().views.channel;
|
const {focusedPostId} = getState().views.channel;
|
||||||
const channel = getState().entities.channels.channels[post.channel_id];
|
const channel = getState().entities.channels.channels[post.channel_id];
|
||||||
if (post.id === focusedPostId && channel) {
|
if (post.id === focusedPostId && channel) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
|
||||||
|
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
@@ -265,6 +266,12 @@ function handlePostEditEvent(msg) {
|
|||||||
function handlePostDeleteEvent(msg) {
|
function handlePostDeleteEvent(msg) {
|
||||||
const post = JSON.parse(msg.data.post);
|
const post = JSON.parse(msg.data.post);
|
||||||
dispatch({type: PostTypes.POST_DELETED, 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) {
|
async function handleTeamAddedEvent(msg) {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import * as PostUtils from 'utils/post_utils.jsx';
|
|||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
const ActionTypes = Constants.ActionTypes;
|
const ActionTypes = Constants.ActionTypes;
|
||||||
import {Posts} from 'mattermost-redux/constants';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
@@ -187,7 +186,7 @@ export default class SearchResultsItem extends React.Component {
|
|||||||
let message;
|
let message;
|
||||||
let flagContent;
|
let flagContent;
|
||||||
let rhsControls;
|
let rhsControls;
|
||||||
if (post.state === Posts.POST_DELETED) {
|
if (post.state === Constants.POST_DELETED) {
|
||||||
message = (
|
message = (
|
||||||
<p>
|
<p>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user