mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 04:14:26 +01:00
18 lines
582 B
TypeScript
18 lines
582 B
TypeScript
import Component from "./component.js";
|
|
import appContext, { CommandListener, CommandListenerData } from "./app_context.js";
|
|
|
|
export type Screen = "detail" | "tree";
|
|
|
|
export default class MobileScreenSwitcherExecutor extends Component
|
|
implements CommandListener<"setActiveScreen">
|
|
{
|
|
private activeScreen?: Screen;
|
|
|
|
setActiveScreenCommand({screen}: CommandListenerData<"setActiveScreen">) {
|
|
if (screen !== this.activeScreen) {
|
|
this.activeScreen = screen;
|
|
this.triggerEvent('activeScreenChanged', {activeScreen: screen});
|
|
}
|
|
}
|
|
}
|