diff options
author | David Gay <david@davidgay.org> | 2021-06-03 22:09:32 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-03 22:09:32 -0400 |
commit | 55f5b6680a4a0f9cc721a50e926f9d1d76e76066 (patch) | |
tree | eb4f2d259961519ba8e588fe8cf774283abfdeac /app/javascript/controllers | |
parent | 01797eadac7ec4bf5df06e0a025ae1af8b5ebdd1 (diff) |
Timer: Don't start and stop updating with controller connects/disconnects
Diffstat (limited to 'app/javascript/controllers')
-rw-r--r-- | app/javascript/controllers/timer_controller.js | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js index 901ec0a..ef741bf 100644 --- a/app/javascript/controllers/timer_controller.js +++ b/app/javascript/controllers/timer_controller.js @@ -13,16 +13,9 @@ export default class extends Controller { this.counter = this.startValue; this.timerTarget.textContent = this.counter; this.postFailures = 0; - } - - connect() { this.startUpdating(); } - disconnect() { - this.stopUpdating(); - } - startUpdating() { let controller = this; this.timerInterval = setInterval(() => { @@ -50,10 +43,4 @@ export default class extends Controller { } }, 1000); } - - stopUpdating() { - if (this.timerInterval) { - clearInterval(this.timerInterval); - } - } } |