mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
feat: increment running timer
This commit is contained in:
@@ -239,6 +239,12 @@ class EventTimer extends Timer {
|
||||
socket.emit('timer', this.getObject());
|
||||
});
|
||||
|
||||
socket.on('increment-timer', (data) => {
|
||||
if (isNaN(parseInt(data))) return;
|
||||
if (data < -5 || data > 5) return;
|
||||
this.increment(data * 1000 * 60);
|
||||
});
|
||||
|
||||
/*******************************************/
|
||||
// playstate
|
||||
socket.on('set-playstate', (data) => {
|
||||
@@ -624,6 +630,14 @@ class EventTimer extends Timer {
|
||||
this.broadcastState();
|
||||
}
|
||||
|
||||
increment(amount) {
|
||||
// call super
|
||||
super.increment(amount);
|
||||
|
||||
// broadcast current state
|
||||
this.broadcastState();
|
||||
}
|
||||
|
||||
goto(eventIndex) {
|
||||
// load event
|
||||
this.loadEvent(eventIndex);
|
||||
|
||||
Reference in New Issue
Block a user