Skip to content

Commit

Permalink
Close right panel chat when minimising maximised voip widget
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Oct 18, 2024
1 parent 90e8c13 commit 1b4e94d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,18 +579,21 @@ export default class AppTile extends React.Component<IProps, IState> {
: 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 => {
Expand Down

0 comments on commit 1b4e94d

Please sign in to comment.