feat: reload on change

This commit is contained in:
cv
2021-04-24 23:24:36 +02:00
parent 01eec95637
commit 65ffd09410
4 changed files with 78 additions and 10 deletions
+6 -2
View File
@@ -54,7 +54,7 @@ class Timer {
if (!this.showNegative) {
this.current = Math.max(this._finishAt + this._pausedTotal - now, 0);
} else {
(this.current = this._finishAt + this._pausedTotal - now), 0;
this.current = this._finishAt + this._pausedTotal - now;
}
break;
case 'pause':
@@ -99,6 +99,11 @@ class Timer {
this._pausedTotal = null;
}
// get elapsed time
getElapsed() {
return this.duration - this.current;
}
// getObject
getObject() {
this.update();
@@ -142,7 +147,6 @@ class Timer {
pause() {
// do we need to change
if (this.state === 'pause') return;
else if (this.duration === 0) return;
// update pause time