Skip to content

Commit 3294c6b

Browse files
authored
Close right panel chat when minimising maximised voip widget (#28241)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 249c0fd commit 3294c6b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/components/views/elements/AppTile.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,18 +579,21 @@ export default class AppTile extends React.Component<IProps, IState> {
579579
: Container.Center;
580580
WidgetLayoutStore.instance.moveToContainer(this.props.room, this.props.app, targetContainer);
581581

582-
// If the right panel has a timeline, but we're about to show the timeline in the main view, pop the right panel
583-
if (
584-
targetContainer === Container.Top &&
585-
RightPanelStore.instance.currentCardForRoom(this.props.room.roomId).phase === RightPanelPhases.Timeline
586-
) {
587-
RightPanelStore.instance.popCard(this.props.room.roomId);
588-
}
582+
if (targetContainer === Container.Top) this.closeChatCardIfNeeded();
589583
};
590584

591585
private onMinimiseClicked = (): void => {
592586
if (!this.props.room) return; // ignore action - it shouldn't even be visible
593587
WidgetLayoutStore.instance.moveToContainer(this.props.room, this.props.app, Container.Right);
588+
this.closeChatCardIfNeeded();
589+
};
590+
591+
private closeChatCardIfNeeded = (): void => {
592+
if (!this.props.room) return; // ignore action - it shouldn't even be visible
593+
// If the right panel has a timeline, but we're about to show the timeline in the main view, pop the right panel
594+
if (RightPanelStore.instance.currentCardForRoom(this.props.room.roomId).phase === RightPanelPhases.Timeline) {
595+
RightPanelStore.instance.popCard(this.props.room.roomId);
596+
}
594597
};
595598

596599
private onContextMenuClick = (): void => {

0 commit comments

Comments
 (0)