From 7e91c0412520d637414f2145dce7fbf2aa1e5169 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 17 Nov 2026 22:04:06 +0900 Subject: [PATCH] refac --- src/lib/components/chat/FileNav.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/FileNav.svelte b/src/lib/components/chat/FileNav.svelte index 6c60dd9a84..4b6718a674 100644 --- a/src/lib/components/chat/FileNav.svelte +++ b/src/lib/components/chat/FileNav.svelte @@ -235,7 +235,7 @@ export let dirty = false; let diskChanged = false; let overwriteChoice: ((replace: boolean) => void) | null = null; - let saveTarget: (TerminalTarget & { path: string }) | null = null; + let selectedFileLocation: (TerminalTarget & { path: string }) | null = null; let dirtyChoice: { sending: boolean; resolve: (confirmed: boolean) => void; @@ -354,7 +354,7 @@ // Preserve translations for the former save notifications during extraction. // $i18n.t('File saved'); $i18n.t('Failed to save file'); const saveFile = async (content: string) => { - const target = saveTarget; + const target = selectedFileLocation; if ( diskChanged && !(await new Promise((resolve) => { @@ -380,7 +380,7 @@ new File([content], name, { type: 'text/plain' }) ); if (!result) throw new Error('Failed to save file. Your changes are still in the editor.'); - if (saveTarget === target) { + if (selectedFileLocation === target) { fileContent = content; diskChanged = false; } @@ -1217,7 +1217,7 @@ } openedFile = null; - saveTarget = null; + selectedFileLocation = null; dirty = false; loading = true; error = null; @@ -1399,7 +1399,7 @@ if (terminalContext) terminalContext = { ...terminalContext, file: null }; dirty = false; diskChanged = false; - saveTarget = { ...terminal, path: filePath }; + selectedFileLocation = { ...terminal, path: filePath }; pendingFile = filesystemFile( { path: filePath, name: entry.name, size: entry.size, modified: entry.modified }, selector,