mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
16 lines
575 B
TypeScript
16 lines
575 B
TypeScript
import Component from "./component.js";
|
|
import type { 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 });
|
|
}
|
|
}
|
|
}
|