summaryrefslogtreecommitdiffstats
path: root/webapp/components/dot_menu/dot_menu.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/dot_menu/dot_menu.jsx')
-rw-r--r--webapp/components/dot_menu/dot_menu.jsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/components/dot_menu/dot_menu.jsx b/webapp/components/dot_menu/dot_menu.jsx
index a2cbb9b48..6a64981d0 100644
--- a/webapp/components/dot_menu/dot_menu.jsx
+++ b/webapp/components/dot_menu/dot_menu.jsx
@@ -71,6 +71,15 @@ export default class DotMenu extends Component {
$('#' + this.props.idPrefix + '_dropdown' + this.props.post.id).on('hidden.bs.dropdown', () => this.props.handleDropdownOpened(false));
}
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.post !== this.props.post) {
+ this.state = {
+ canDelete: PostUtils.canDeletePost(nextProps.post),
+ canEdit: PostUtils.canEditPost(nextProps.post, this.editDisableAction)
+ };
+ }
+ }
+
componentWillUnmount() {
this.editDisableAction.cancel();
}