Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 1bd0d9e

Browse files
committed
Iterate
Signed-off-by: Michael Telatynski <[email protected]>
1 parent fbcea7d commit 1bd0d9e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/components/views/elements/ReplyThread.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,17 @@ export default class ReplyThread extends React.Component {
235235
}
236236
}
237237

238+
updateForEventId = (eventId) => {
239+
if (this.state.events.some(event => event.getId() === eventId)) {
240+
this.forceUpdate();
241+
}
242+
};
243+
238244
onEventReplaced = (ev) => {
239245
if (this.unmounted) return;
240246

241-
// If one of the events we are rendering gets redacted, force a re-render
242-
if (this.state.events.some(event => event.getId() === ev.getId())) {
243-
this.forceUpdate();
244-
}
247+
// If one of the events we are rendering gets replaced, force a re-render
248+
this.updateForEventId(ev.getId());
245249
};
246250

247251
onRoomRedaction = (ev) => {
@@ -251,9 +255,7 @@ export default class ReplyThread extends React.Component {
251255
if (!eventId) return;
252256

253257
// If one of the events we are rendering gets redacted, force a re-render
254-
if (this.state.events.some(event => event.getId() === eventId)) {
255-
this.forceUpdate();
256-
}
258+
this.updateForEventId(eventId);
257259
};
258260

259261
async initialize() {

0 commit comments

Comments
 (0)