diff options
author | Saturnino Abril <saturnino.abril@gmail.com> | 2017-08-15 23:20:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 23:20:19 +0800 |
commit | 8e646763e71b548991cb262a227e097f06daa758 (patch) | |
tree | 08d8253c3962f812870d4e710f90b80dfdf97c74 /webapp | |
parent | fcd56927df53ee6b681f7235e6e7e5597a45385c (diff) | |
download | chat-8e646763e71b548991cb262a227e097f06daa758.tar.gz chat-8e646763e71b548991cb262a227e097f06daa758.tar.bz2 chat-8e646763e71b548991cb262a227e097f06daa758.zip |
[PLT-7180] Fix delete/edit not showing on DotMenu at parent post of RHS (#7214)
* fix delete/edit not showing on DotMenu at parent post of RHS
* remove unnecessary shouldComponentUpdate
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/dot_menu/dot_menu.jsx | 9 |
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(); } |