forked from mystiq/hydrogen-web
also show redaction reason for redaction local echo
This commit is contained in:
parent
15f6ab8b7e
commit
7a96f84cab
3 changed files with 13 additions and 2 deletions
|
@ -24,7 +24,11 @@ export class RedactedTile extends BaseMessageTile {
|
||||||
get description() {
|
get description() {
|
||||||
const {redactionReason} = this._entry;
|
const {redactionReason} = this._entry;
|
||||||
if (this.isRedacting) {
|
if (this.isRedacting) {
|
||||||
|
if (redactionReason) {
|
||||||
|
return this.i18n`This message is being deleted (${redactionReason})…`;
|
||||||
|
} else {
|
||||||
return this.i18n`This message is being deleted…`;
|
return this.i18n`This message is being deleted…`;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (redactionReason) {
|
if (redactionReason) {
|
||||||
return this.i18n`This message has been deleted (${redactionReason}).`;
|
return this.i18n`This message has been deleted (${redactionReason}).`;
|
||||||
|
|
|
@ -31,6 +31,13 @@ export class BaseEventEntry extends BaseEntry {
|
||||||
return this.isRedacting;
|
return this.isRedacting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get redactionReason() {
|
||||||
|
if (this._pendingRedactions) {
|
||||||
|
return this._pendingRedactions[0].content?.reason;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
aggregates local relation.
|
aggregates local relation.
|
||||||
@return [string] returns the name of the field that has changed, if any
|
@return [string] returns the name of the field that has changed, if any
|
||||||
|
|
|
@ -122,6 +122,6 @@ export class EventEntry extends BaseEventEntry {
|
||||||
if (redactionEvent) {
|
if (redactionEvent) {
|
||||||
return redactionEvent.content?.reason;
|
return redactionEvent.content?.reason;
|
||||||
}
|
}
|
||||||
return null;
|
return super.redactionReason;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue