Reset auto-pause timer on digit input

This commit is contained in:
Thomas Hallock 2025-12-28 15:11:48 -06:00
parent ca1ed1980a
commit 01a606af4e
1 changed files with 10 additions and 3 deletions

View File

@ -971,6 +971,13 @@ export function ActiveSession({
// Track last resume time to reset auto-pause timer after resuming // Track last resume time to reset auto-pause timer after resuming
const lastResumeTimeRef = useRef<number>(0) const lastResumeTimeRef = useRef<number>(0)
const handleDigitWithTimerReset = useCallback(
(digit: string) => {
lastResumeTimeRef.current = Date.now()
handleDigit(digit)
},
[handleDigit]
)
// Reset dismissed states when help context changes (new help session) // Reset dismissed states when help context changes (new help session)
useEffect(() => { useEffect(() => {
@ -1306,7 +1313,7 @@ export function ActiveSession({
e.preventDefault() e.preventDefault()
handleSubmit() handleSubmit()
} else if (/^[0-9]$/.test(e.key)) { } else if (/^[0-9]$/.test(e.key)) {
handleDigit(e.key) handleDigitWithTimerReset(e.key)
} }
} }
@ -1316,7 +1323,7 @@ export function ActiveSession({
hasPhysicalKeyboard, hasPhysicalKeyboard,
canAcceptInput, canAcceptInput,
handleSubmit, handleSubmit,
handleDigit, handleDigitWithTimerReset,
handleBackspace, handleBackspace,
showHelpOverlay, showHelpOverlay,
exitHelpMode, exitHelpMode,
@ -1886,7 +1893,7 @@ export function ActiveSession({
{/* On-screen keypad for mobile - includes submit button */} {/* On-screen keypad for mobile - includes submit button */}
{showOnScreenKeypad && ( {showOnScreenKeypad && (
<NumericKeypad <NumericKeypad
onDigit={handleDigit} onDigit={handleDigitWithTimerReset}
onBackspace={handleBackspace} onBackspace={handleBackspace}
onSubmit={handleSubmit} onSubmit={handleSubmit}
disabled={isSubmitting} disabled={isSubmitting}