mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
fix paused (#486)
* fix: prevent timer continue on paused count up * refactor: throw if not found on delete
This commit is contained in:
@@ -47,18 +47,3 @@ export function getCurrent(
|
||||
}
|
||||
return startedAt + duration + addedTime + pausedTime - clock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates elapsed time
|
||||
*/
|
||||
export function getElapsed(startedAt: number | null, clock: number): number | null {
|
||||
if (startedAt === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// we are in the day after
|
||||
if (startedAt > clock) {
|
||||
return dayInMs - startedAt + clock;
|
||||
}
|
||||
return clock - startedAt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user