fix(practice): reset of a running open practice restarts its clock from zero (1.70.3)
This commit is contained in:
1 parent
8f748d21df
commit
5323444679
5 files changed
+15
-4
No files matched your search
@@ -608,6 +608,10 @@ function resetSessionData(session) {
|
||||
// the server's live-results protection when the reset came right after the last lap.
|
||||
ensureSessionResult(session.id);
|
||||
Object.assign(session, { status: "ready", startedAt: null, endedAt: null, finishedByTimer: false, pausedAt: null, totalPausedMs: 0, followUpPausedMs: 0, audioAnnouncements: [] });
|
||||
} else if (["running", "paused"].includes(session.status)) {
|
||||
// A practice that keeps running: its clock starts again from zero (a paused one stays paused at 0:00).
|
||||
const now = Date.now();
|
||||
Object.assign(session, { startedAt: now, pausedAt: session.status === "paused" ? now : null, totalPausedMs: 0, followUpPausedMs: 0, audioAnnouncements: [] });
|
||||
}
|
||||
lastFinishAnnouncementSessionId = null;
|
||||
delete lastOverlayLeaderKeyBySession[session.id];
|
||||
|
||||
Reference in new issue
Block a user