From 39711c1eddf85e5278013592388d498bfa8b1b3e Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Tue, 30 Jan 2024 12:35:54 +0100 Subject: [PATCH] refactor: time-to-end always updates (#739) --- apps/server/src/state.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/server/src/state.ts b/apps/server/src/state.ts index b8b180be8..b9df0bf57 100644 --- a/apps/server/src/state.ts +++ b/apps/server/src/state.ts @@ -394,6 +394,10 @@ export const stateMutations = { const result = play(); _shouldNotify = true; _isFinished = result.isFinished; + } else if (state.eventNow?.timerType === TimerType.TimeToEnd) { + // or if we are in a time-to-end timer + state.timer.current = getCurrent(state); + state.timer.duration = state.timer.current; } // we only update the store at the updateInterval