From 2f2bf38e3481077597b5ad60f57685813e8d71b8 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 27 Jul 2026 03:19:10 -0400 Subject: [PATCH] refac --- src/lib/components/chat/FileNav.svelte | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lib/components/chat/FileNav.svelte b/src/lib/components/chat/FileNav.svelte index aeb09fc73e..247d8fc3a3 100644 --- a/src/lib/components/chat/FileNav.svelte +++ b/src/lib/components/chat/FileNav.svelte @@ -845,7 +845,7 @@ }; // ── Lifecycle ──────────────────────────────────────────────────────── - onMount(async () => { + onMount(() => { const terminal = getTerminal(); let handledDisplayFile = false; @@ -904,16 +904,18 @@ if (!handledDisplayFile && terminal) { loading = true; - // Discover server features on initial mount - const config = await getTerminalConfig(terminal.url, terminal.key); - terminalEnabled = config?.features?.terminal !== false; + void (async () => { + // Discover server features on initial mount + const config = await getTerminalConfig(terminal.url, terminal.key); + terminalEnabled = config?.features?.terminal !== false; - if (chatId || savedPath === '/') { - // Fetch session-specific cwd from the server (or global default for new chats) - savedPath = applyCwd(await getCwd(terminal.url, terminal.key, chatId ?? undefined)); - } - savedPath = clampToFileRoot(savedPath); - loadDir(savedPath); + if (chatId || savedPath === '/') { + // Fetch session-specific cwd from the server (or global default for new chats) + savedPath = applyCwd(await getCwd(terminal.url, terminal.key, chatId ?? undefined)); + } + savedPath = clampToFileRoot(savedPath); + loadDir(savedPath); + })(); } mounted = true;