summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-07-13 01:31:09 +0900
committerGitHub <noreply@github.com>2017-07-13 01:31:09 +0900
commitb1322746d2ceb5b840b4ad0d3ffc770f6b73d83b (patch)
tree9eb89a5a8edc1a5cc4974c33cf2042e2a8f6dea6 /webapp
parent6a056a0042d0df6c1c377d4bfeb6a3d10017ae3f (diff)
downloadchat-b1322746d2ceb5b840b4ad0d3ffc770f6b73d83b.tar.gz
chat-b1322746d2ceb5b840b4ad0d3ffc770f6b73d83b.tar.bz2
chat-b1322746d2ceb5b840b4ad0d3ffc770f6b73d83b.zip
dismiss deleted message in RHS (#6914)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/actions/global_actions.jsx7
-rw-r--r--webapp/components/rhs_comment.jsx6
-rw-r--r--webapp/components/rhs_thread/index.js12
-rw-r--r--webapp/components/rhs_thread/rhs_thread.jsx6
4 files changed, 19 insertions, 12 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 6bdd7c4b4..e37e702a2 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -332,13 +332,6 @@ export function emitPreferencesDeletedEvent(preferences) {
});
}
-export function emitRemovePost(post) {
- AppDispatcher.handleViewAction({
- type: Constants.ActionTypes.REMOVE_POST,
- post
- });
-}
-
export function sendEphemeralPost(message, channelId) {
const timestamp = Utils.getTimestamp();
const post = {
diff --git a/webapp/components/rhs_comment.jsx b/webapp/components/rhs_comment.jsx
index 202be9748..68190da98 100644
--- a/webapp/components/rhs_comment.jsx
+++ b/webapp/components/rhs_comment.jsx
@@ -11,7 +11,6 @@ import FailedPostOptions from 'components/post_view/failed_post_options';
import DotMenu from 'components/dot_menu';
import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx';
-import * as GlobalActions from 'actions/global_actions.jsx';
import {addReaction} from 'actions/post_actions.jsx';
import TeamStore from 'stores/team_store.jsx';
@@ -56,7 +55,7 @@ export default class RhsComment extends React.Component {
}
removePost() {
- GlobalActions.emitRemovePost(this.props.post);
+ this.props.removePost(this.props.post);
}
createRemovePostButton() {
@@ -447,5 +446,6 @@ RhsComment.propTypes = {
isFlagged: PropTypes.bool,
status: PropTypes.string,
isBusy: PropTypes.bool,
- getPostList: PropTypes.func.isRequired
+ getPostList: PropTypes.func.isRequired,
+ removePost: PropTypes.func.isRequired
};
diff --git a/webapp/components/rhs_thread/index.js b/webapp/components/rhs_thread/index.js
index c4465cafd..ed7618427 100644
--- a/webapp/components/rhs_thread/index.js
+++ b/webapp/components/rhs_thread/index.js
@@ -2,7 +2,9 @@
// See License.txt for license information.
import {connect} from 'react-redux';
+import {bindActionCreators} from 'redux';
import {getPost, makeGetPostsForThread} from 'mattermost-redux/selectors/entities/posts';
+import {removePost} from 'mattermost-redux/actions/posts';
import RhsThread from './rhs_thread.jsx';
@@ -24,4 +26,12 @@ function makeMapStateToProps() {
};
}
-export default connect(makeMapStateToProps)(RhsThread);
+function mapDispatchToProps(dispatch) {
+ return {
+ actions: bindActionCreators({
+ removePost
+ }, dispatch)
+ };
+}
+
+export default connect(makeMapStateToProps, mapDispatchToProps)(RhsThread);
diff --git a/webapp/components/rhs_thread/rhs_thread.jsx b/webapp/components/rhs_thread/rhs_thread.jsx
index bbf61af19..5ce6af018 100644
--- a/webapp/components/rhs_thread/rhs_thread.jsx
+++ b/webapp/components/rhs_thread/rhs_thread.jsx
@@ -59,7 +59,10 @@ export default class RhsThread extends React.Component {
currentUser: PropTypes.object.isRequired,
useMilitaryTime: PropTypes.bool.isRequired,
toggleSize: PropTypes.func,
- shrink: PropTypes.func
+ shrink: PropTypes.func,
+ actions: PropTypes.shape({
+ removePost: PropTypes.func.isRequired
+ }).isRequired
}
static defaultProps = {
@@ -401,6 +404,7 @@ export default class RhsThread extends React.Component {
status={status}
isBusy={this.state.isBusy}
getPostList={this.getPostListContainer}
+ removePost={this.props.actions.removePost}
/>
</div>
);