mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
Typescript null (#869)
* refactor: improve null checking * fix: return result of mutation
This commit is contained in:
@@ -64,6 +64,7 @@ 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
|
||||
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