aboutsummaryrefslogtreecommitdiff
path: root/src/timer.js
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2025-11-14 17:57:28 +0100
committerKaran Jayachandra <karan.jayachandra@nxp.com>2025-11-14 17:57:28 +0100
commit0aab565ffb594069abaf6b3e25c25737523a7bf3 (patch)
tree23c6aac1aebc58055a4e6e1d7cfc443c5a169eb5 /src/timer.js
parent06d6cf87acfd4582beb6beb314c6f1d7c3fe9675 (diff)
Only the history is pending
Diffstat (limited to 'src/timer.js')
-rw-r--r--src/timer.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/timer.js b/src/timer.js
index 7c70550..c00ffdc 100644
--- a/src/timer.js
+++ b/src/timer.js
@@ -2,17 +2,12 @@ const milliSecond = 1000;
export class Timer {
pointer = 0;
+ mins = Number(sessionStorage.getItem("mins")) || 12;
+ running = Boolean(Number(sessionStorage.getItem("running"))) || false;
+ deadline = Number(sessionStorage.getItem("deadline")) || new Date().getTime();
constructor() {
- this.mins = Number(sessionStorage.getItem("mins")) || 12;
- this.running = Boolean(Number(sessionStorage.getItem("running"))) || false;
- this.deadline =
- Number(sessionStorage.getItem("deadline")) || new Date().getTime();
- if (this.running) {
- this.start(false);
- } else {
- this.reset();
- }
+ this.running ? this.start(false) : this.reset();
addTimerBehaviour(this);
}
store() {