diff options
Diffstat (limited to 'packages/ui/src/components')
| -rw-r--r-- | packages/ui/src/components/bottom-bar.tsx | 14 | ||||
| -rw-r--r-- | packages/ui/src/components/instance-editor-modal.tsx | 15 |
2 files changed, 19 insertions, 10 deletions
diff --git a/packages/ui/src/components/bottom-bar.tsx b/packages/ui/src/components/bottom-bar.tsx index 8f70985..2746e00 100644 --- a/packages/ui/src/components/bottom-bar.tsx +++ b/packages/ui/src/components/bottom-bar.tsx @@ -21,13 +21,17 @@ export function BottomBar() { const account = useAuthStore((state) => state.account); const instances = useInstanceStore((state) => state.instances); const activeInstance = useInstanceStore((state) => state.activeInstance); - const setActiveInstance = useInstanceStore((state) => state.setActiveInstance); + const setActiveInstance = useInstanceStore( + (state) => state.setActiveInstance, + ); const selectedVersion = useGameStore((state) => state.selectedVersion); const setSelectedVersion = useGameStore((state) => state.setSelectedVersion); const startGame = useGameStore((state) => state.startGame); const stopGame = useGameStore((state) => state.stopGame); const runningInstanceId = useGameStore((state) => state.runningInstanceId); - const launchingInstanceId = useGameStore((state) => state.launchingInstanceId); + const launchingInstanceId = useGameStore( + (state) => state.launchingInstanceId, + ); const stoppingInstanceId = useGameStore((state) => state.stoppingInstanceId); const [showLoginModal, setShowLoginModal] = useState(false); @@ -39,7 +43,7 @@ export function BottomBar() { } setSelectedVersion(nextVersion); - }, [activeInstance?.id, activeInstance?.versionId, selectedVersion, setSelectedVersion]); + }, [activeInstance?.versionId, selectedVersion, setSelectedVersion]); const handleInstanceChange = useCallback( async (instanceId: string) => { @@ -47,7 +51,9 @@ export function BottomBar() { return; } - const nextInstance = instances.find((instance) => instance.id === instanceId); + const nextInstance = instances.find( + (instance) => instance.id === instanceId, + ); if (!nextInstance) { return; } diff --git a/packages/ui/src/components/instance-editor-modal.tsx b/packages/ui/src/components/instance-editor-modal.tsx index 2a2bd7d..105d7e9 100644 --- a/packages/ui/src/components/instance-editor-modal.tsx +++ b/packages/ui/src/components/instance-editor-modal.tsx @@ -1,8 +1,12 @@ - import { toNumber } from "es-toolkit/compat"; import { Folder, Loader2, Save, Trash2, X } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { toast } from "sonner"; +import { + deleteInstanceFile, + listInstanceDirectory, + openFileExplorer, +} from "@/client"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -18,7 +22,6 @@ import { useInstanceStore } from "@/models/instance"; import { useSettingsStore } from "@/models/settings"; import type { FileInfo } from "../types/bindings/core"; import type { Instance } from "../types/bindings/instance"; -import { deleteInstanceFile, listInstanceDirectory, openFileExplorer } from "@/client"; type Props = { open: boolean; @@ -97,7 +100,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { setFileList(files); } catch (err) { console.error("Failed to load files:", err); - toast.error("Failed to load files: " + String(err)); + toast.error(`Failed to load files: ${String(err)}`); setFileList([]); } finally { setLoadingFiles(false); @@ -137,7 +140,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { toast.success("Deleted"); } catch (err) { console.error("Failed to delete file:", err); - toast.error("Failed to delete file: " + String(err)); + toast.error(`Failed to delete file: ${String(err)}`); } finally { setDeletingPath(null); } @@ -148,7 +151,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { await openFileExplorer(filePath); } catch (err) { console.error("Failed to open in explorer:", err); - toast.error("Failed to open file explorer: " + String(err)); + toast.error(`Failed to open file explorer: ${String(err)}`); } } @@ -180,7 +183,7 @@ export function InstanceEditorModal({ open, instance, onOpenChange }: Props) { } catch (err) { console.error("Failed to save instance:", err); setErrorMessage(String(err)); - toast.error("Failed to save instance: " + String(err)); + toast.error(`Failed to save instance: ${String(err)}`); } finally { setSaving(false); } |