Skip to content

fix: clear stale timer state on new workout start#31

Merged
willchan merged 1 commit intomainfrom
claude/fix-workout-timer-bug-b7Zoy
Mar 19, 2026
Merged

fix: clear stale timer state on new workout start#31
willchan merged 1 commit intomainfrom
claude/fix-workout-timer-bug-b7Zoy

Conversation

@willchan
Copy link
Owner

No description provided.

When navigating away from a workout while a rest timer was running (e.g.
pressing Back), the timer state was left in IndexedDB. On the next workout
load, the recovery code would find the stale timer and fire the notification
and/or show "Time's Up!" immediately.

Two fixes:
1. renderWorkout now clears any stale timer state when starting fresh (not
   resuming an active workout), preventing the recovery code from
   misinterpreting a leftover timer from a previous session.
2. The Back button handler now calls putTimerState(null) so the timer is
   explicitly cleaned up when the user navigates away mid-rest.

https://claude.ai/code/session_01W41HrMh4pZma1AiT7fHRxd
@willchan willchan merged commit d08214d into main Mar 19, 2026
1 check passed
@willchan willchan deleted the claude/fix-workout-timer-bug-b7Zoy branch March 19, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants