feat(worker): poll + reconcile stopwatch to server (admin stop/cancel)

This commit is contained in:
Bas van Rossem
2026-06-17 22:50:31 +02:00
parent f1ec249ee7
commit 7d3daaa760
3 changed files with 95 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ export function useActiveSessions() {
return useQuery({
queryKey: ['sessions', 'active'],
queryFn: () => apiFetch<WorkSession[]>('/api/sessions/active'),
// Poll so the stopwatch converges to admin changes (stop/cancel) within ~15s.
refetchInterval: 15000,
});
}