Skip to content

fix: variable shadowing crash in cancel, duplicate FilePicker modal#473

Open
fix2015 wants to merge 1 commit into
winfunc:mainfrom
fix2015:fix/variable-shadowing-crash-and-duplicate-modal
Open

fix: variable shadowing crash in cancel, duplicate FilePicker modal#473
fix2015 wants to merge 1 commit into
winfunc:mainfrom
fix2015:fix/variable-shadowing-crash-and-duplicate-modal

Conversation

@fix2015

@fix2015 fix2015 commented Jul 3, 2026

Copy link
Copy Markdown

Two bugs:

  • `handleCancelExecution` declared a local `const sessionStartTime` (a number) that shadowed the `useRef` of the same name at the top of the component. When the code later accesses `sessionStartTime.current`, it's trying to read `.current` on a plain number instead of a ref — crashes with TypeError every time a user cancels execution. Renamed the local variable.

  • The `showProjectPicker` modal block was copy-pasted and rendered twice in App.tsx (two identical blocks). When the user opens the file picker, two overlapping modals appear and both `onSelect` handlers fire, potentially creating duplicate projects or corrupting state. Removed the duplicate.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant