From bc7a8f8406e960772e16932dd4df96daf38ba6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 13 Jul 2021 10:12:24 +0200 Subject: [PATCH] Handle redaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/ReplyTile.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/views/rooms/ReplyTile.tsx b/src/components/views/rooms/ReplyTile.tsx index fdd43e3200..fd90d2d536 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -45,6 +45,7 @@ export default class ReplyTile extends React.PureComponent { 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 { } }; + 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.