aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/components/VersionsView.svelte
diff options
context:
space:
mode:
authorHsiangNianian <i@jyunko.cn>2026-01-16 20:20:19 +0800
committerHsiangNianian <i@jyunko.cn>2026-01-16 20:20:19 +0800
commit743401f15199a116b1777bced843c774c5a59fba (patch)
tree24c53e8882392b03fa5a65c874c547fbacab791a /ui/src/components/VersionsView.svelte
parent3c13c14dea03c6b91716fb0f1578deb12fcf9756 (diff)
downloadDropOut-743401f15199a116b1777bced843c774c5a59fba.tar.gz
DropOut-743401f15199a116b1777bced843c774c5a59fba.zip
feat: add InstancesView component and integrate instance management into the UI
Introduced a new InstancesView component for managing game instances, allowing users to create, edit, delete, and duplicate instances. Updated the App.svelte to include the InstancesView and modified various components to ensure instance selection is handled correctly. Enhanced the ModLoaderSelector and VersionsView to check for active instances before performing actions. Updated the Sidebar to include navigation to the new InstancesView.
Diffstat (limited to 'ui/src/components/VersionsView.svelte')
-rw-r--r--ui/src/components/VersionsView.svelte14
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,