simplify canRedact logic in view by overriding in RedactedTile
This commit is contained in:
parent
23459aad52
commit
606d40c9d4
2 changed files with 5 additions and 1 deletions
|
@ -38,6 +38,10 @@ export class RedactedTile extends BaseMessageTile {
|
||||||
return this._entry.isRedacting;
|
return this._entry.isRedacting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get canRedact() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
abortPendingRedaction() {
|
abortPendingRedaction() {
|
||||||
return this._entry.abortPendingRedaction();
|
return this._entry.abortPendingRedaction();
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ export class BaseMessageView extends TemplateView {
|
||||||
const options = [];
|
const options = [];
|
||||||
if (vm.isPending) {
|
if (vm.isPending) {
|
||||||
options.push(Menu.option(vm.i18n`Cancel`, () => vm.abortSending()));
|
options.push(Menu.option(vm.i18n`Cancel`, () => vm.abortSending()));
|
||||||
} else if (vm.shape !== "redacted" && vm.canRedact) {
|
} else if (vm.canRedact) {
|
||||||
options.push(Menu.option(vm.i18n`Delete`, () => vm.redact()).setDestructive());
|
options.push(Menu.option(vm.i18n`Delete`, () => vm.redact()).setDestructive());
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
|
|
Reference in a new issue