Hide Remove button in message editing history if you don't have permission to redact

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2019-11-27 22:30:30 -06:00
parent ac8afe6dd1
commit 1bb55d4fa1
No known key found for this signature in database
GPG key ID: 37419210002890EF

View file

@ -102,9 +102,9 @@ export default class EditHistoryMessage extends React.PureComponent {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
// hide the button when already redacted
let redactButton;
if (!this.props.mxEvent.isRedacted() && !this.props.isBaseEvent) {
if (!this.props.mxEvent.isRedacted() && !this.props.isBaseEvent && this.state.canRedact) {
redactButton = (
<AccessibleButton onClick={this._onRedactClick} disabled={!this.state.canRedact}>
<AccessibleButton onClick={this._onRedactClick}>
{_t("Remove")}
</AccessibleButton>
);