also show redaction reason for redaction local echo

This commit is contained in:
Bruno Windels 2021-06-02 12:17:09 +02:00
parent 15f6ab8b7e
commit 7a96f84cab
3 changed files with 13 additions and 2 deletions

View file

@ -24,7 +24,11 @@ export class RedactedTile extends BaseMessageTile {
get description() {
const {redactionReason} = this._entry;
if (this.isRedacting) {
return this.i18n`This message is being deleted …`;
if (redactionReason) {
return this.i18n`This message is being deleted (${redactionReason})…`;
} else {
return this.i18n`This message is being deleted…`;
}
} else {
if (redactionReason) {
return this.i18n`This message has been deleted (${redactionReason}).`;

View file

@ -31,6 +31,13 @@ export class BaseEventEntry extends BaseEntry {
return this.isRedacting;
}
get redactionReason() {
if (this._pendingRedactions) {
return this._pendingRedactions[0].content?.reason;
}
return null;
}
/**
aggregates local relation.
@return [string] returns the name of the field that has changed, if any

View file

@ -122,6 +122,6 @@ export class EventEntry extends BaseEventEntry {
if (redactionEvent) {
return redactionEvent.content?.reason;
}
return null;
return super.redactionReason;
}
}