Prevented RHS from closing when you reply to a message that had been deleted. (#5651)

Этот коммит содержится в:
Christopher Speller
2017-03-06 16:10:43 -05:00
коммит произвёл Corey Hulen
родитель a87cb40993
Коммит 944e74feb8
3 изменённых файлов: 2 добавлений и 27 удалений

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

@@ -212,11 +212,6 @@ function handlePostEditEvent(msg) {
function handlePostDeleteEvent(msg) {
const post = JSON.parse(msg.data.post);
GlobalActions.emitPostDeletedEvent(post);
const selectedPostId = PostStore.getSelectedPostId();
if (selectedPostId === post.id) {
GlobalActions.emitCloseRightHandSide();
}
}
function handleLeaveTeamEvent(msg) {

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

@@ -209,6 +209,8 @@ export default class CreateComment extends React.Component {
(err) => {
if (err.id === 'api.post.create_post.root_id.app_error') {
this.showPostDeletedModal();
PostStore.removePendingPost(post.channel_id, post.pending_post_id);
this.setState({message: post.message});
} else {
this.forceUpdate();
}

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

@@ -1,13 +1,8 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import Constants from 'utils/constants.jsx';
import {FormattedMessage} from 'react-intl';
var ActionTypes = Constants.ActionTypes;
import {Modal} from 'react-bootstrap';
import React from 'react';
@@ -26,23 +21,6 @@ export default class PostDeletedModal extends React.Component {
handleHide(e) {
e.preventDefault();
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_SEARCH,
results: null
});
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_SEARCH_TERM,
term: null,
do_search: false,
is_mention_search: false
});
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST_SELECTED,
postId: null
});
this.props.onHide();
}