Bug description
In src/hooks/useKeyboardShortcuts.ts, the useEffect hook that listens for keyboard events uses the resetSettings function inside the key handler (case "r" / "R")
However, resetSettings is missing from the hook's dependency array at the end of the useEffect block
This leads to potentially stale closure issues where pressing R might trigger an outdated copy of resetSettings or fail to react properly if resetSettings changes.
Expected behavior
All referenced variables and functions inside the useEffect scope should be correctly listed in the dependency array to ensure the latest versions are always executed.
Proposed Fix
Add resetSettings to the dependency array of the useEffect hook in src/hooks/useKeyboardShortcuts.ts
Bug description
In
src/hooks/useKeyboardShortcuts.ts, theuseEffecthook that listens for keyboard events uses theresetSettingsfunction inside the key handler (case "r" / "R")However,
resetSettingsis missing from the hook's dependency array at the end of theuseEffectblockThis leads to potentially stale closure issues where pressing
Rmight trigger an outdated copy ofresetSettingsor fail to react properly ifresetSettingschanges.Expected behavior
All referenced variables and functions inside the
useEffectscope should be correctly listed in the dependency array to ensure the latest versions are always executed.Proposed Fix
Add
resetSettingsto the dependency array of theuseEffecthook insrc/hooks/useKeyboardShortcuts.ts