diff options
| author | 2026-03-29 21:32:54 +0800 | |
|---|---|---|
| committer | 2026-03-29 21:32:54 +0800 | |
| commit | 5b799a125a970e5e56f29a08b3c86450855fb6c4 (patch) | |
| tree | 0467ce21983865b189f7daa9fe293faf04a149f2 /packages/ui/src/components/bottom-bar.tsx | |
| parent | ffbfce895c37e8e8306d426a2e59e73647ed6a86 (diff) | |
| download | DropOut-5b799a125a970e5e56f29a08b3c86450855fb6c4.tar.gz DropOut-5b799a125a970e5e56f29a08b3c86450855fb6c4.zip | |
refactor(ui): rewrite instance create
Diffstat (limited to 'packages/ui/src/components/bottom-bar.tsx')
| -rw-r--r-- | packages/ui/src/components/bottom-bar.tsx | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/packages/ui/src/components/bottom-bar.tsx b/packages/ui/src/components/bottom-bar.tsx index fd4a681..f73ace4 100644 --- a/packages/ui/src/components/bottom-bar.tsx +++ b/packages/ui/src/components/bottom-bar.tsx @@ -1,5 +1,5 @@ import { Play, User, XIcon } from "lucide-react"; -import { useCallback, useEffect, useState } from "react"; +import { useCallback, useState } from "react"; import { toast } from "sonner"; import { cn } from "@/lib/utils"; import { useAuthStore } from "@/models/auth"; @@ -29,18 +29,8 @@ export function BottomBar() { stopGame, } = useGameStore(); - const [selectedVersion, setSelectedVersion] = useState<string | null>(null); const [showLoginModal, setShowLoginModal] = useState(false); - useEffect(() => { - const nextVersion = activeInstance?.versionId ?? ""; - if (selectedVersion === nextVersion) { - return; - } - - setSelectedVersion(nextVersion); - }, [activeInstance?.versionId, selectedVersion]); - const handleInstanceChange = useCallback( async (instanceId: string) => { if (activeInstance?.id === instanceId) { @@ -70,10 +60,7 @@ export function BottomBar() { return; } - await startGame( - activeInstance.id, - selectedVersion || activeInstance.versionId, - ); + await startGame(activeInstance.id, activeInstance.versionId ?? ""); }; const handleStopGame = async () => { |