create addTime function in simple timer (#1363)

* create addTime function in simple timer
This commit is contained in:
Alex Christoffer Rasmussen
2024-12-04 20:25:49 +01:00
committed by GitHub
parent e6aa7404f7
commit 607bc40673
3 changed files with 69 additions and 2 deletions
@@ -1,4 +1,4 @@
import { SimpleDirection, SimpleTimerState } from 'ontime-types';
import { SimpleDirection, SimplePlayback, SimpleTimerState } from 'ontime-types';
import { SimpleTimer } from '../../classes/simple-timer/SimpleTimer.js';
import { eventStore } from '../../stores/EventStore.js';
@@ -59,7 +59,11 @@ export class AuxTimerService {
@broadcastReturn
addTime(millis: number) {
return this.timer.setTime(this.timer.state.current + millis);
if (this.timer.state.playback === SimplePlayback.Start) {
this.timer.addTime(millis);
return this.timer.update(this.getTime());
}
return this.timer.addTime(millis);
}
@broadcastReturn