From 39178217ecf722fbd902e07a053e35fa290488f8 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 7 Jun 2021 21:24:02 -0400 Subject: Hook in new web worker stuff with finish activity POST retry stuff --- public/timer_worker.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/timer_worker.js b/public/timer_worker.js index 3d3e79a..c62679a 100644 --- a/public/timer_worker.js +++ b/public/timer_worker.js @@ -1,10 +1,11 @@ let timerInterval = null; +let timerTimeout = 10; function setTimerInterval() { if (!timerInterval) { timerInterval = setInterval(function() { postMessage("timerTick"); - }, 10); + }, timerTimeout); } } @@ -20,5 +21,7 @@ onmessage = function(event) { } else { clearTimerInterval(); } + } else if ("set_timeout" in event.data) { + timerTimeout = event.data["set_timeout"]; } } -- cgit v1.2.3