From 1b4e94d96502be65affaeeb3c46d8836f48bac44 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 18 Oct 2024 15:54:55 +0100 Subject: [PATCH] Close right panel chat when minimising maximised voip widget Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/AppTile.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 145c1b22ca9..becd4cdecd0 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -579,18 +579,21 @@ export default class AppTile extends React.Component { : Container.Center; WidgetLayoutStore.instance.moveToContainer(this.props.room, this.props.app, targetContainer); - // If the right panel has a timeline, but we're about to show the timeline in the main view, pop the right panel - if ( - targetContainer === Container.Top && - RightPanelStore.instance.currentCardForRoom(this.props.room.roomId).phase === RightPanelPhases.Timeline - ) { - RightPanelStore.instance.popCard(this.props.room.roomId); - } + if (targetContainer === Container.Top) this.closeChatCardIfNeeded(); }; private onMinimiseClicked = (): void => { if (!this.props.room) return; // ignore action - it shouldn't even be visible WidgetLayoutStore.instance.moveToContainer(this.props.room, this.props.app, Container.Right); + this.closeChatCardIfNeeded(); + }; + + private closeChatCardIfNeeded = (): void => { + if (!this.props.room) return; // ignore action - it shouldn't even be visible + // If the right panel has a timeline, but we're about to show the timeline in the main view, pop the right panel + if (RightPanelStore.instance.currentCardForRoom(this.props.room.roomId).phase === RightPanelPhases.Timeline) { + RightPanelStore.instance.popCard(this.props.room.roomId); + } }; private onContextMenuClick = (): void => {