mirror of
https://github.com/Chevron7Locked/kima-hub.git
synced 2026-06-19 07:37:17 +00:00
e110b6d77e
Progress was saved every 30s off the "timeupdate" event, but iOS throttles and suspends that event when the PWA is backgrounded (screen off) -- the normal way people listen to audiobooks. So a long screen-off session was never checkpointed, and an app update (or crash) reverted to the moment the screen was locked. The saved data was never lost; it just stopped advancing in the background. Replace the timeupdate-driven save with a 15s wall-clock setInterval that runs while playing (started on "play", stopped on "pause"/"ended"), independent of the media event iOS throttles. saveAudiobookProgress already de-dupes an unchanged position and the tick is gated on isPlaying(), so paused/stalled ticks are no-ops. Applies to podcasts too.