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

Commit

Permalink
Pop right panel timeline when unmaximising widget to avoid double tim…
Browse files Browse the repository at this point in the history
…eline (#94)

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Sep 27, 2024
1 parent 81192f6 commit ef9e310
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import { WidgetMessagingStore } from "../../../stores/widgets/WidgetMessagingSto
import { SdkContextClass } from "../../../contexts/SDKContext";
import { ModuleRunner } from "../../../modules/ModuleRunner";
import { parseUrl } from "../../../utils/UrlUtils";
import RightPanelStore from "../../../stores/right-panel/RightPanelStore.ts";
import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases.ts";

interface IProps {
app: IWidget | IApp;
Expand Down Expand Up @@ -576,6 +578,14 @@ export default class AppTile extends React.Component<IProps, IState> {
? Container.Top
: 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);
}
};

private onMinimiseClicked = (): void => {
Expand Down

0 comments on commit ef9e310

Please sign in to comment.