mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 17:33:55 +00:00
refactor: use strict typing
This commit is contained in:
committed by
Carlos Valente
parent
4ed38340e0
commit
178640bfc4
@@ -86,6 +86,12 @@ export class SimpleTimer {
|
||||
public update(timeNow: number): SimpleTimerState {
|
||||
if (this.state.playback === SimplePlayback.Start) {
|
||||
// we know startedAt is not null since we are in play mode
|
||||
// eslint-disable-next-line no-unused-labels -- dev code path
|
||||
DEV: {
|
||||
if (this.startedAt === null) {
|
||||
throw new Error('SimpleTimer.update: invalid state received');
|
||||
}
|
||||
}
|
||||
const elapsed = timeNow - this.startedAt;
|
||||
if (this.state.direction === SimpleDirection.CountDown) {
|
||||
this.state.current = this.state.duration - elapsed;
|
||||
|
||||
Reference in New Issue
Block a user