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

Commit ef9e310

Browse files
authored
Pop right panel timeline when unmaximising widget to avoid double timeline (#94)
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 81192f6 commit ef9e310

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/views/elements/AppTile.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ import { WidgetMessagingStore } from "../../../stores/widgets/WidgetMessagingSto
5050
import { SdkContextClass } from "../../../contexts/SDKContext";
5151
import { ModuleRunner } from "../../../modules/ModuleRunner";
5252
import { parseUrl } from "../../../utils/UrlUtils";
53+
import RightPanelStore from "../../../stores/right-panel/RightPanelStore.ts";
54+
import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases.ts";
5355

5456
interface IProps {
5557
app: IWidget | IApp;
@@ -576,6 +578,14 @@ export default class AppTile extends React.Component<IProps, IState> {
576578
? Container.Top
577579
: Container.Center;
578580
WidgetLayoutStore.instance.moveToContainer(this.props.room, this.props.app, targetContainer);
581+
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+
}
579589
};
580590

581591
private onMinimiseClicked = (): void => {

0 commit comments

Comments
 (0)