aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src
diff options
context:
space:
mode:
authorNatsuu <natsukawa247@outlook.com>2026-01-14 03:54:44 +0000
committerNatsuu <natsukawa247@outlook.com>2026-01-14 03:54:44 +0000
commit4675607a34f57e3a1bd6f3cf065079aa5aca40f1 (patch)
treea82b0bb28756a01e9be50b540d935f351a588543 /ui/src
parent66f401fd1248ce8d1624ec82342af5e07c51554e (diff)
downloadDropOut-4675607a34f57e3a1bd6f3cf065079aa5aca40f1.tar.gz
DropOut-4675607a34f57e3a1bd6f3cf065079aa5aca40f1.zip
refactor: specify generic type for invoke calls in GameState class
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/stores/game.svelte.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/src/stores/game.svelte.ts b/ui/src/stores/game.svelte.ts
index feaf8d6..0af3daf 100644
--- a/ui/src/stores/game.svelte.ts
+++ b/ui/src/stores/game.svelte.ts
@@ -9,7 +9,7 @@ export class GameState {
async loadVersions() {
try {
- this.versions = await invoke("get_versions");
+ 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;
@@ -35,9 +35,9 @@ export class GameState {
uiState.setStatus("Preparing to launch " + this.selectedVersion + "...");
console.log("Invoking start_game for version:", this.selectedVersion);
try {
- const msg = await invoke("start_game", { versionId: this.selectedVersion });
+ const msg = await invoke<string>("start_game", { versionId: this.selectedVersion });
console.log("Response:", msg);
- uiState.setStatus(msg as string);
+ uiState.setStatus(msg);
} catch (e) {
console.error(e);
uiState.setStatus("Error: " + e);