Commit f26bf25
committed
Fix Ctrl/Cmd+Enter shortcut: use refs to avoid stale closure
The useEffect captured a stale handleRunAll on mount because
useCallback dependencies changed on every render. Now uses
refs to always access the latest function and state without
re-registering the event listener.1 parent 4a03d35 commit f26bf25
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
605 | 611 | | |
606 | 612 | | |
607 | 613 | | |
608 | 614 | | |
609 | | - | |
610 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
611 | 618 | | |
612 | 619 | | |
613 | 620 | | |
614 | 621 | | |
615 | 622 | | |
616 | | - | |
| 623 | + | |
617 | 624 | | |
618 | 625 | | |
619 | 626 | | |
| |||
0 commit comments