summaryrefslogtreecommitdiffstats
path: root/webapp/components/rhs_thread
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/rhs_thread')
-rw-r--r--webapp/components/rhs_thread/index.js12
-rw-r--r--webapp/components/rhs_thread/rhs_thread.jsx17
2 files changed, 17 insertions, 12 deletions
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..58325e8cc 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 = {
@@ -316,10 +319,6 @@ export default class RhsThread extends React.Component {
});
}
- getPostListContainer = () => {
- return this.refs.postListContainer;
- }
-
getSidebarBody = () => {
return this.refs.sidebarbody;
}
@@ -400,7 +399,7 @@ export default class RhsThread extends React.Component {
isFlagged={isFlagged}
status={status}
isBusy={this.state.isBusy}
- getPostList={this.getPostListContainer}
+ removePost={this.props.actions.removePost}
/>
</div>
);
@@ -435,10 +434,7 @@ export default class RhsThread extends React.Component {
renderView={renderView}
onScroll={this.handleScroll}
>
- <div
- ref='postListContainer'
- className='post-right__scroll'
- >
+ <div className='post-right__scroll'>
<DateSeparator
date={rootPostDay}
/>
@@ -454,7 +450,6 @@ export default class RhsThread extends React.Component {
status={rootStatus}
previewCollapsed={this.state.previewsCollapsed}
isBusy={this.state.isBusy}
- getPostList={this.getPostListContainer}
/>
<div
ref='rhspostlist'