Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
PLT-3960 Don't show (message deleted) placeholder to the user that de…
Browse files Browse the repository at this point in the history
…leted the message (mattermost#4839)

* on post delete remove the whole post for the owner of the post while other user will still see post deleted message

* now the deleter wont see the post while the other users will see deleted message

* removed fromSocket check and now calling PostStore.removePost instead of PostStore.deletePost from view

* fixed the bug which was causing to show message deleted until next action

* added remove post from store to global action

* moved removePostFromStore from global actions to post actions
  • Loading branch information
khawerrind authored and crspeller committed Jan 3, 2017
1 parent ebb189b commit 7f1626d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions actions/post_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,8 @@ export function createPost(post, doLoadPost, success, error) {
}
);
}

export function removePostFromStore(post) {
PostStore.removePost(post);
PostStore.emitChange();
}
4 changes: 2 additions & 2 deletions components/delete_post_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ModalStore from 'stores/modal_store.jsx';
import {Modal} from 'react-bootstrap';
import * as AsyncClient from 'utils/async_client.jsx';
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import {removePostFromStore} from 'actions/post_actions.jsx';
import Constants from 'utils/constants.jsx';

import {FormattedMessage} from 'react-intl';
Expand Down Expand Up @@ -54,8 +55,7 @@ export default class DeletePostModal extends React.Component {
this.state.post.channel_id,
this.state.post.id,
() => {
PostStore.deletePost(this.state.post);

removePostFromStore(this.state.post);
if (this.state.post.id === PostStore.getSelectedPostId()) {
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_POST_SELECTED,
Expand Down

0 comments on commit 7f1626d

Please sign in to comment.