Skip to content

[BUG] Missing resetSettings dependency in useKeyboardShortcuts useEffect hook #953

@Hastiv01

Description

@Hastiv01

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working correctlygssoc'26GirlScript Summer of Code 2026level:beginnerBeginner level - 20 ptstype:bugBug fix

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions