From 01a606af4e9039455fb1490dda9d2c9e396f1ce2 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Sun, 28 Dec 2025 15:11:48 -0600 Subject: [PATCH] Reset auto-pause timer on digit input --- apps/web/src/components/practice/ActiveSession.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/practice/ActiveSession.tsx b/apps/web/src/components/practice/ActiveSession.tsx index 381ebf02..b4a1ae7b 100644 --- a/apps/web/src/components/practice/ActiveSession.tsx +++ b/apps/web/src/components/practice/ActiveSession.tsx @@ -971,6 +971,13 @@ export function ActiveSession({ // Track last resume time to reset auto-pause timer after resuming const lastResumeTimeRef = useRef(0) + const handleDigitWithTimerReset = useCallback( + (digit: string) => { + lastResumeTimeRef.current = Date.now() + handleDigit(digit) + }, + [handleDigit] + ) // Reset dismissed states when help context changes (new help session) useEffect(() => { @@ -1306,7 +1313,7 @@ export function ActiveSession({ e.preventDefault() handleSubmit() } else if (/^[0-9]$/.test(e.key)) { - handleDigit(e.key) + handleDigitWithTimerReset(e.key) } } @@ -1316,7 +1323,7 @@ export function ActiveSession({ hasPhysicalKeyboard, canAcceptInput, handleSubmit, - handleDigit, + handleDigitWithTimerReset, handleBackspace, showHelpOverlay, exitHelpMode, @@ -1886,7 +1893,7 @@ export function ActiveSession({ {/* On-screen keypad for mobile - includes submit button */} {showOnScreenKeypad && (