Handle redaction

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-13 10:12:24 +02:00
parent 9455a6d772
commit bc7a8f8406
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,7 @@ export default class ReplyTile extends React.PureComponent<IProps> {
componentDidMount() {
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
this.props.mxEvent.on("Event.beforeRedaction", this.onBeforeRedaction);
}
componentWillUnmount() {
@ -58,6 +59,11 @@ export default class ReplyTile extends React.PureComponent<IProps> {
}
};
private onBeforeRedaction = (): void => {
// When the event gets redacted, update it, so that a different tile handler is used
this.forceUpdate();
};
private onClick = (e: React.MouseEvent): void => {
// This allows the permalink to be opened in a new tab/window or copied as
// matrix.to, but also for it to enable routing within Riot when clicked.