[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
Этот коммит содержится в:
Saturnino Abril
2017-08-15 23:20:19 +08:00
коммит произвёл GitHub
родитель fcd56927df
Коммит 8e646763e7

Просмотреть файл

@@ -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();
}