Merge branch 'master' into wip/migratedb

This commit is contained in:
cv
2021-05-28 14:46:54 +02:00
27 changed files with 284 additions and 110 deletions
+8 -2
View File
@@ -8,6 +8,7 @@ export class Timer {
clock = null;
duration = null;
current = null;
secondaryTimer = null;
_finishAt = null;
_finishedAt = null;
_startedAt = null;
@@ -50,6 +51,9 @@ export class Timer {
// check playstate
switch (this.state) {
case 'start':
// ensure we have a start time
if (this._startedAt == null) this._startedAt = now;
// update current timer
this.current =
this._startedAt + this.duration + this._pausedTotal - now;
@@ -110,8 +114,10 @@ export class Timer {
);
}
_resetTimers() {
_resetTimers(total = false) {
if (total) this.duration = null;
this.current = this.duration;
this.secondaryTimer = null;
this._finishAt = null;
this._finishedAt = null;
this._startedAt = null;
@@ -132,7 +138,7 @@ export class Timer {
return {
clock: this.clock,
running: Timer.toSeconds(this.current),
currentSeconds: Timer.toSeconds(Math.max(this.current, 0)),
secondary: Timer.toSeconds(this.secondaryTimer),
durationSeconds: Timer.toSeconds(this.duration),
expectedFinish: this._getExpectedFinish(),
startedAt: this._startedAt,