diff options
| author | 2026-01-16 20:56:27 +0800 | |
|---|---|---|
| committer | 2026-01-16 20:56:27 +0800 | |
| commit | fd4d01a629105d9405a6cecb2a1efd3ffa6a9334 (patch) | |
| tree | 831d979118234ae8b1a2eebdfe7187c2ff966391 /ui/src/components/VersionsView.svelte | |
| parent | 1119f6c3cf421da2f2db92873efae8135c76b678 (diff) | |
| parent | bb6cf77844343bbf55be3dad201340572564d132 (diff) | |
| download | DropOut-fd4d01a629105d9405a6cecb2a1efd3ffa6a9334.tar.gz DropOut-fd4d01a629105d9405a6cecb2a1efd3ffa6a9334.zip | |
Merge pull request #55 from HsiangNianian/feat/Instance/Profile-System
Diffstat (limited to 'ui/src/components/VersionsView.svelte')
| -rw-r--r-- | ui/src/components/VersionsView.svelte | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/src/components/VersionsView.svelte b/ui/src/components/VersionsView.svelte index 2e8b028..d4d36d5 100644 --- a/ui/src/components/VersionsView.svelte +++ b/ui/src/components/VersionsView.svelte @@ -2,6 +2,7 @@ import { invoke } from "@tauri-apps/api/core"; import { listen, type UnlistenFn } from "@tauri-apps/api/event"; import { gameState } from "../stores/game.svelte"; + import { instancesState } from "../stores/instances.svelte"; import ModLoaderSelector from "./ModLoaderSelector.svelte"; let searchQuery = $state(""); @@ -18,11 +19,17 @@ // Load installed modded versions with Java version info (both Fabric and Forge) async function loadInstalledModdedVersions() { + if (!instancesState.activeInstanceId) { + installedFabricVersions = []; + isLoadingModded = false; + return; + } isLoadingModded = true; try { // Get all installed versions and filter for modded ones (Fabric and Forge) const allInstalled = await invoke<Array<{ id: string; type: string }>>( - "list_installed_versions" + "list_installed_versions", + { instanceId: instancesState.activeInstanceId } ); // Filter for Fabric and Forge versions @@ -36,7 +43,10 @@ try { const javaVersion = await invoke<number | null>( "get_version_java_version", - { versionId: id } + { + instanceId: instancesState.activeInstanceId!, + versionId: id, + } ); return { id, |