diff --git a/frontend/src/stores/schedule.js b/frontend/src/stores/schedule.js index b3a75fa..311391b 100644 --- a/frontend/src/stores/schedule.js +++ b/frontend/src/stores/schedule.js @@ -44,10 +44,11 @@ export const useScheduleStore = defineStore('schedule', () => { morningRoutine.value = snapshot.morning_routine || [] // Restore elapsed time from server-computed value and seed the per-block cache const serverElapsed = snapshot.block_elapsed_seconds || 0 - if (snapshot.session?.current_block_id && serverElapsed > 0) { + if (snapshot.session?.current_block_id) { blockElapsedCache.value[snapshot.session.current_block_id] = serverElapsed blockElapsedOffset.value = serverElapsed - // Only start the live counter if the block is actually running (not paused) + // Start the live counter only when the block is actually running (not paused). + // Use serverElapsed == 0 is fine here — a just-reset block is still running. blockStartedAt.value = isPaused.value ? null : Date.now() } else { blockElapsedOffset.value = 0