Skip to content

Commit 6709a58

Browse files
committed
perf: remove RoomEvent.UnreadNotifications from ThreadReplyChip
Fired on every room message, causing N×chip re-renders and O(n_events) scans per message when N threads are visible. ThreadEvent.NewReply/Update and RoomEvent.Redaction already cover the relevant updates.
1 parent fde829d commit 6709a58

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/app/hooks/timeline/useTimelineEventRenderer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,10 @@ function ThreadReplyChip({
120120
thread.on(ThreadEvent.NewReply as any, onUpdate);
121121
thread.on(ThreadEvent.Update as any, onUpdate);
122122
room.on(RoomEvent.Redaction as any, onUpdate);
123-
room.on(RoomEvent.UnreadNotifications as any, onUpdate);
124123
return () => {
125124
thread.off(ThreadEvent.NewReply as any, onUpdate);
126125
thread.off(ThreadEvent.Update as any, onUpdate);
127126
room.off(RoomEvent.Redaction as any, onUpdate);
128-
room.off(RoomEvent.UnreadNotifications as any, onUpdate);
129127
};
130128
}, [room, thread]);
131129

0 commit comments

Comments
 (0)