Fix End Day not updating dashboard without refresh

Broadcast is_active in WS timer payload so the frontend can immediately
clear the session when the backend marks it complete.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 23:43:04 -08:00
parent 15ce6dbb4d
commit ad10f9bc61
2 changed files with 6 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ async def timer_action(
"session_id": session.id,
"block_id": event.block_id,
"current_block_id": session.current_block_id,
"is_active": session.is_active,
}
await manager.broadcast(session.child_id, ws_payload)

View File

@@ -31,6 +31,11 @@ export const useScheduleStore = defineStore('schedule', () => {
applySnapshot(event)
return
}
// Session ended
if (event.is_active === false) {
session.value = null
return
}
// Timer events update session state
if (event.current_block_id !== undefined && session.value) {
session.value.current_block_id = event.current_block_id