This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/components/views/elements Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments