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

Commit 727c885

Browse files
author
Kerry
authored
Fix: Threads button is highlighted when I create a new room (#10819)
* fix thread button highlight logic * lint
1 parent 81a23ac commit 727c885

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/components/views/right_panel/RoomHeaderButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export default class RoomHeaderButtons extends HeaderButtons<IProps> {
301301
title={_t("Threads")}
302302
onClick={this.onThreadsPanelClicked}
303303
isHighlighted={this.isPhase(RoomHeaderButtons.THREAD_PHASES)}
304-
isUnread={this.state.threadNotificationColor > 0}
304+
isUnread={this.state.threadNotificationColor > NotificationColor.None}
305305
>
306306
<UnreadIndicator color={this.state.threadNotificationColor} />
307307
</HeaderButton>,

test/components/views/right_panel/RoomHeaderButtons-test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ describe("RoomHeaderButtons-test.tsx", function () {
7070

7171
it("thread notification does change the thread button", () => {
7272
const { container } = getComponent(room);
73+
expect(getThreadButton(container)!.className.includes("mx_RightPanel_headerButton_unread")).toBeFalsy();
7374

7475
room.setThreadUnreadNotificationCount("$123", NotificationCountType.Total, 1);
76+
expect(getThreadButton(container)!.className.includes("mx_RightPanel_headerButton_unread")).toBeTruthy();
7577
expect(isIndicatorOfType(container, "gray")).toBe(true);
7678

7779
room.setThreadUnreadNotificationCount("$123", NotificationCountType.Highlight, 1);

0 commit comments

Comments
 (0)