From 6f529852cdb43b8853cd2e1115bbde0635be30ac Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 14 Aug 2019 23:27:04 +0100 Subject: [PATCH] Skip forceUpdate in ReplyThread if the redacted event is not relevant Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/ReplyThread.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index 126b4ef017..08630a16a5 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -198,9 +198,10 @@ export default class ReplyThread extends React.Component { onRoomRedaction = (ev, room) => { if (this.unmounted) return; - // we could skip an update if the event isn't in our timeline, - // but that's probably an early optimisation. - this.forceUpdate(); + // If one of the events we are rendering gets redacted, force a re-render + if (this.state.events.some(event => event.getId() === ev.getId())) { + this.forceUpdate(); + } }; async initialize() {