summaryrefslogtreecommitdiffstats
path: root/webapp/components/dot_menu
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-08-17 09:35:36 -0700
committerChristopher Speller <crspeller@gmail.com>2017-08-17 09:35:36 -0700
commitfd1301779fecc2910a9fdcf93af52ff33a4349ba (patch)
treeccd8b35d347b77c8c6a99db9422b3dbc0ff3bd2d /webapp/components/dot_menu
parentd41f1695e99a81808f5dc1fbe7820062947b5291 (diff)
parent0033e3e37b12cb5d951d21492500d66a6abc472b (diff)
downloadchat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.tar.gz
chat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.tar.bz2
chat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.zip
Merge branch 'release-4.1'
Diffstat (limited to 'webapp/components/dot_menu')
-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();
}