mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
simplify canRedact logic in view by overriding in RedactedTile
This commit is contained in:
parent
23459aad52
commit
606d40c9d4
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user