diff options
| author | 2026-03-02 10:26:21 +0800 | |
|---|---|---|
| committer | 2026-03-02 10:26:21 +0800 | |
| commit | 9e40b5b7bea60e6802a4b448ef315b14fba4de7f (patch) | |
| tree | da58ce5de37c3c47cbc82fea5ed343b163852f46 /packages/ui/src/components/bottom-bar.tsx | |
| parent | 47aeabf5d44d7483101d30d289cb4c56761e3faa (diff) | |
| download | DropOut-9e40b5b7bea60e6802a4b448ef315b14fba4de7f.tar.gz DropOut-9e40b5b7bea60e6802a4b448ef315b14fba4de7f.zip | |
feat(ui): java config
Diffstat (limited to 'packages/ui/src/components/bottom-bar.tsx')
| -rw-r--r-- | packages/ui/src/components/bottom-bar.tsx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/packages/ui/src/components/bottom-bar.tsx b/packages/ui/src/components/bottom-bar.tsx index 5489675..0710c3a 100644 --- a/packages/ui/src/components/bottom-bar.tsx +++ b/packages/ui/src/components/bottom-bar.tsx @@ -6,7 +6,6 @@ import { listInstalledVersions, startGame } from "@/client"; import { cn } from "@/lib/utils"; import { useAuthStore } from "@/models/auth"; import { useInstanceStore } from "@/models/instance"; -import { useGameStore } from "@/stores/game-store"; import { LoginModal } from "./login-modal"; import { Button } from "./ui/button"; import { @@ -26,7 +25,6 @@ interface InstalledVersion { export function BottomBar() { const authStore = useAuthStore(); - const gameStore = useGameStore(); const instancesStore = useInstanceStore(); const [isLaunched, setIsLaunched] = useState<boolean>(false); @@ -51,24 +49,18 @@ export function BottomBar() { const versions = await listInstalledVersions( instancesStore.activeInstance.id, ); - - const installed = versions || []; - setInstalledVersions(installed); + setInstalledVersions(versions); // If no version is selected but we have installed versions, select the first one - if (!gameStore.selectedVersion && installed.length > 0) { - gameStore.setSelectedVersion(installed[0].id); + if (!selectedVersion && versions.length > 0) { + setSelectedVersion(versions[0].id); } } catch (error) { console.error("Failed to load installed versions:", error); } finally { setIsLoadingVersions(false); } - }, [ - instancesStore.activeInstance, - gameStore.selectedVersion, - gameStore.setSelectedVersion, - ]); + }, [instancesStore.activeInstance, selectedVersion]); useEffect(() => { loadInstalledVersions(); @@ -225,6 +217,7 @@ export function BottomBar() { </div> <Select + value={selectedVersion} items={versionOptions} onValueChange={setSelectedVersion} disabled={isLoadingVersions} @@ -238,7 +231,7 @@ export function BottomBar() { } /> </SelectTrigger> - <SelectContent> + <SelectContent alignItemWithTrigger={false}> <SelectGroup> {versionOptions.map((item) => ( <SelectItem |