From d69b744ae7f84298060d07bd20aad01d53e2876a Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Fri, 13 Mar 2026 22:45:55 +0800 Subject: [PATCH] fix: resolve variable redeclaration in Terminal.svelte Change 'const d' to 'let d' to allow reassignment in nested scopes --- dashboard/frontend/src/routes/Terminal.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/frontend/src/routes/Terminal.svelte b/dashboard/frontend/src/routes/Terminal.svelte index de75c1f..db3c6b8 100644 --- a/dashboard/frontend/src/routes/Terminal.svelte +++ b/dashboard/frontend/src/routes/Terminal.svelte @@ -267,7 +267,7 @@ async function connect(forceRefresh = false) { // Always refresh token before first connection to ensure fresh cookies - const d = tabData.get(tabId); + let d = tabData.get(tabId); const isFirstConnect = !d?.hasConnectedOnce; if (forceRefresh || isFirstConnect) { @@ -343,7 +343,7 @@ }; ws.onclose = async (e) => { const reason = e.reason || `Connection closed (code ${e.code})`; - const d = tabData.get(tabId); + d = tabData.get(tabId); if (d) d.ws = null; // Handle auth failures (code 1008) @@ -386,13 +386,13 @@ } }; ws.onerror = () => { - const d = tabData.get(tabId); + d = tabData.get(tabId); if (d) d.ws = null; if (!closedManually) scheduleReconnect("Connection failed"); else updateTab(tabId, { connected: false, error: "Connection failed" }); }; - const d = tabData.get(tabId); + d = tabData.get(tabId); if (d) { d.ws = ws; d.heartbeat = heartbeat;