aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2026-01-14 14:19:15 +0800
committerGitHub <noreply@github.com>2026-01-14 14:19:15 +0800
commit21c66d00d8d300b33a353a366fa23d0773deb413 (patch)
tree4f78d28583470c4c6ce8b635e2ba600f691bcc3f /ui/src
parent45551629e1f84060d56efb3e9b362af10a1caded (diff)
downloadDropOut-21c66d00d8d300b33a353a366fa23d0773deb413.tar.gz
DropOut-21c66d00d8d300b33a353a366fa23d0773deb413.zip
Revert "feat: add functionality to retrieve installed game versions"
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/components/BottomBar.svelte7
-rw-r--r--ui/src/stores/game.svelte.ts32
2 files changed, 6 insertions, 33 deletions
diff --git a/ui/src/components/BottomBar.svelte b/ui/src/components/BottomBar.svelte
index a96b086..dcad9e8 100644
--- a/ui/src/components/BottomBar.svelte
+++ b/ui/src/components/BottomBar.svelte
@@ -65,13 +65,10 @@
>
{#if gameState.versions.length === 0}
<option>Loading...</option>
- {:else if gameState.installedVersionIds.length === 0}
- <option disabled>No installed versions</option>
{:else}
{#each gameState.versions as version}
- {#if gameState.installedVersionIds.includes(version.id)}
- <option value={version.id}>{version.id} ({version.type})</option>
- {/if}
+ <option value={version.id}>{version.id} ({version.type})</option
+ >
{/each}
{/if}
</select>
diff --git a/ui/src/stores/game.svelte.ts b/ui/src/stores/game.svelte.ts
index f66cc71..0af3daf 100644
--- a/ui/src/stores/game.svelte.ts
+++ b/ui/src/stores/game.svelte.ts
@@ -5,38 +5,14 @@ import { authState } from "./auth.svelte";
export class GameState {
versions = $state<Version[]>([]);
- installedVersionIds = $state<string[]>([]);
selectedVersion = $state("");
async loadVersions() {
try {
- // Fetch both full version list and installed versions
- const [allVersions, installedIds] = await Promise.all([
- invoke<Version[]>("get_versions"),
- invoke<string[]>("get_installed_versions")
- ]);
-
- this.versions = allVersions;
- this.installedVersionIds = installedIds;
-
- if (this.installedVersionIds.length > 0) {
- // Find the first installed version that appears in our manifest (preserving order)
- // Usually we want the latest release that is installed
- const installedVersions = this.versions.filter(v => this.installedVersionIds.includes(v.id));
-
- // Try to find latest release among installed
- const latestInstalledRelease = installedVersions.find(v => v.type === "release");
-
- if (latestInstalledRelease) {
- this.selectedVersion = latestInstalledRelease.id;
- } else if (installedVersions.length > 0) {
- this.selectedVersion = installedVersions[0].id;
- } else {
- // Fallback to just the first ID if not in manifest
- this.selectedVersion = this.installedVersionIds[0];
- }
- } else {
- this.selectedVersion = "";
+ this.versions = await invoke<Version[]>("get_versions");
+ if (this.versions.length > 0) {
+ const latest = this.versions.find((v) => v.type === "release");
+ this.selectedVersion = latest ? latest.id : this.versions[0].id;
}
} catch (e) {
console.error("Failed to fetch versions:", e);