From 6c856759a1a5980cc7460a27f502b2877dfd80f5 Mon Sep 17 00:00:00 2001 From: "vitalii.semianchuk" Date: Fri, 3 Jul 2026 14:44:36 +0100 Subject: [PATCH] fix: variable shadowing crash in cancel, duplicate FilePicker modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handleCancelExecution declared a local const sessionStartTime that shadowed the useRef of the same name — accessing .current on the local number would crash with TypeError every time a user cancelled - the FilePicker modal block was copy-pasted and rendered twice in App.tsx, causing two overlapping modals to appear and both onSelect handlers to fire simultaneously --- src/App.tsx | 26 -------------------------- src/components/ClaudeCodeSession.tsx | 4 ++-- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1eb89e8b1..b58a795db 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -457,32 +457,6 @@ function AppContent() { )} - {/* File picker modal for selecting project directory */} - {showProjectPicker && ( -
-
- { - if (entry.is_directory) { - // Create or open a project for this directory - try { - const project = await api.createProject(entry.path); - setShowProjectPicker(false); - await loadProjects(); - // Load sessions for the selected project - await handleProjectClick(project); - } catch (err) { - console.error('Failed to create project:', err); - setError('Failed to create project for the selected directory.'); - } - } - }} - onClose={() => setShowProjectPicker(false)} - /> -
-
- )} ); } diff --git a/src/components/ClaudeCodeSession.tsx b/src/components/ClaudeCodeSession.tsx index f0f164f21..9f65d92a1 100644 --- a/src/components/ClaudeCodeSession.tsx +++ b/src/components/ClaudeCodeSession.tsx @@ -984,8 +984,8 @@ export const ClaudeCodeSession: React.FC = ({ if (!claudeSessionId || !isLoading) return; try { - const sessionStartTime = messages.length > 0 ? messages[0].timestamp || Date.now() : Date.now(); - const duration = Date.now() - sessionStartTime; + const sessionStartTimestamp = messages.length > 0 ? messages[0].timestamp || Date.now() : Date.now(); + const duration = Date.now() - sessionStartTimestamp; await api.cancelClaudeExecution(claudeSessionId);