diff options
| author | 2026-01-14 05:16:31 +0100 | |
|---|---|---|
| committer | 2026-01-14 05:16:31 +0100 | |
| commit | f8790b62643cba62b8f329e93e5e3566394441d7 (patch) | |
| tree | f3be16274ad1203e2f8ae4aeffeaf1102c580f4d /ui/src/stores/ui.svelte.ts | |
| parent | f093d2a310627aa3ee5a2820339f8a18bd251e81 (diff) | |
| parent | e8e139c07d05e2f29f04906019dff5f3c520f8cc (diff) | |
| download | DropOut-f8790b62643cba62b8f329e93e5e3566394441d7.tar.gz DropOut-f8790b62643cba62b8f329e93e5e3566394441d7.zip | |
Merge branch 'main' into feat/download-java-rt
Diffstat (limited to 'ui/src/stores/ui.svelte.ts')
| -rw-r--r-- | ui/src/stores/ui.svelte.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/src/stores/ui.svelte.ts b/ui/src/stores/ui.svelte.ts new file mode 100644 index 0000000..9c29c25 --- /dev/null +++ b/ui/src/stores/ui.svelte.ts @@ -0,0 +1,32 @@ +import { type ViewType } from "../types"; + +export class UIState { + currentView: ViewType = $state("home"); + status = $state("Ready"); + showConsole = $state(false); + appVersion = $state("..."); + + private statusTimeout: ReturnType<typeof setTimeout> | null = null; + + setStatus(msg: string) { + if (this.statusTimeout) clearTimeout(this.statusTimeout); + + this.status = msg; + + if (msg !== "Ready") { + this.statusTimeout = setTimeout(() => { + this.status = "Ready"; + }, 5000); + } + } + + toggleConsole() { + this.showConsole = !this.showConsole; + } + + setView(view: ViewType) { + this.currentView = view; + } +} + +export const uiState = new UIState(); |