From fddbc429a9de1ec37aba72e57980688702664d54 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 29 Apr 2022 09:48:57 +0100 Subject: [PATCH] Fix issue with thread notification state ignoring initial events (#8417) --- src/components/views/rooms/EventTile.tsx | 4 +--- src/stores/notifications/ThreadNotificationState.ts | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 6c0bf4635e..c822b92515 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -991,9 +991,7 @@ export class UnwrappedEventTile extends React.Component { mx_EventTile_12hr: this.props.isTwelveHour, // Note: we keep the `sending` state class for tests, not for our styles mx_EventTile_sending: !isEditing && isSending, - mx_EventTile_highlight: (this.context.timelineRenderingType === TimelineRenderingType.Notification - ? false - : this.shouldHighlight()), + mx_EventTile_highlight: this.shouldHighlight(), mx_EventTile_selected: this.props.isSelectedEvent || this.state.contextMenu, mx_EventTile_continuation: isContinuation || eventType === EventType.CallInvite, mx_EventTile_last: this.props.last, diff --git a/src/stores/notifications/ThreadNotificationState.ts b/src/stores/notifications/ThreadNotificationState.ts index 70209d398d..2b2bcf175c 100644 --- a/src/stores/notifications/ThreadNotificationState.ts +++ b/src/stores/notifications/ThreadNotificationState.ts @@ -31,6 +31,10 @@ export class ThreadNotificationState extends NotificationState implements IDestr super(); this.thread.on(ThreadEvent.NewReply, this.handleNewThreadReply); this.thread.on(ThreadEvent.ViewThread, this.resetThreadNotification); + if (this.thread.replyToEvent) { + // Process the current tip event + this.handleNewThreadReply(this.thread, this.thread.replyToEvent); + } } public destroy(): void {