From de88a7c8dfca154bf99bddbc542ac033139c7932 Mon Sep 17 00:00:00 2001 From: Germain Date: Fri, 1 Sep 2023 07:56:29 +0100 Subject: [PATCH] Apply labs flag to legacy room header too --- .../views/right_panel/HeaderButtons.tsx | 8 +++++ .../right_panel/LegacyRoomHeaderButtons.tsx | 32 ++++++++++--------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/components/views/right_panel/HeaderButtons.tsx b/src/components/views/right_panel/HeaderButtons.tsx index d13eb5d2d7..69ab3ea80f 100644 --- a/src/components/views/right_panel/HeaderButtons.tsx +++ b/src/components/views/right_panel/HeaderButtons.tsx @@ -27,6 +27,7 @@ import { IRightPanelCardState } from "../../../stores/right-panel/RightPanelStor import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { NotificationColor } from "../../../stores/notifications/NotificationColor"; import { ActionPayload } from "../../../dispatcher/payloads"; +import SettingsStore from "../../../settings/SettingsStore"; export enum HeaderKind { Room = "room", @@ -37,6 +38,7 @@ interface IState { phase: RightPanelPhases | null; threadNotificationColor: NotificationColor; globalNotificationColor: NotificationColor; + notificationsEnabled?: boolean; } interface IProps {} @@ -44,6 +46,7 @@ interface IProps {} export default abstract class HeaderButtons

extends React.Component { private unmounted = false; private dispatcherRef?: string = undefined; + private readonly watcherRef: string; public constructor(props: IProps & P, kind: HeaderKind) { super(props); @@ -54,7 +57,11 @@ export default abstract class HeaderButtons

extends React.Component + this.setState({ notificationsEnabled: value }), + ); } public componentDidMount(): void { @@ -66,6 +73,7 @@ export default abstract class HeaderButtons

extends React.Component { , ); - rightPanelPhaseButtons.set( - RightPanelPhases.NotificationPanel, - - {this.globalNotificationState.color === NotificationColor.Red ? ( - - ) : null} - , - ); + if (this.state.notificationsEnabled) { + rightPanelPhaseButtons.set( + RightPanelPhases.NotificationPanel, + + {this.globalNotificationState.color === NotificationColor.Red ? ( + + ) : null} + , + ); + } rightPanelPhaseButtons.set( RightPanelPhases.RoomSummary,