diff options
| author | 2026-01-20 13:44:21 +0800 | |
|---|---|---|
| committer | 2026-01-20 13:44:21 +0800 | |
| commit | 7338b8627833018a0e3c05c3c4f3cc7fc182e8d2 (patch) | |
| tree | 23e39e5603aadc10d6b2d7efad063c68f357a860 /ui/src/stores/releases.svelte.ts | |
| parent | dbf781a35b96252e0199fec4337515651e49a8f6 (diff) | |
| parent | cf6cd6ba667b35e352b705946420cf4acab2b004 (diff) | |
| download | DropOut-7338b8627833018a0e3c05c3c4f3cc7fc182e8d2.tar.gz DropOut-7338b8627833018a0e3c05c3c4f3cc7fc182e8d2.zip | |
[Chore] branch: Sync with main (#75)
Diffstat (limited to 'ui/src/stores/releases.svelte.ts')
| -rw-r--r-- | ui/src/stores/releases.svelte.ts | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/ui/src/stores/releases.svelte.ts b/ui/src/stores/releases.svelte.ts deleted file mode 100644 index c858abb..0000000 --- a/ui/src/stores/releases.svelte.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { invoke } from "@tauri-apps/api/core"; - -export interface GithubRelease { - tag_name: string; - name: string; - published_at: string; - body: string; - html_url: string; -} - -export class ReleasesState { - releases = $state<GithubRelease[]>([]); - isLoading = $state(false); - isLoaded = $state(false); - error = $state<string | null>(null); - - async loadReleases() { - // If already loaded or currently loading, skip to prevent duplicate requests - if (this.isLoaded || this.isLoading) return; - - this.isLoading = true; - this.error = null; - - try { - this.releases = await invoke<GithubRelease[]>("get_github_releases"); - this.isLoaded = true; - } catch (e) { - console.error("Failed to load releases:", e); - this.error = String(e); - } finally { - this.isLoading = false; - } - } -} - -export const releasesState = new ReleasesState(); |