From ad3fe3b3e6034705e5c424d6a1246e3c92ec3d02 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 13 Oct 2021 19:38:47 +0100 Subject: [PATCH] checking if test is active before updating style catching errors and defaulting to 1 --- src/js/test/timer-progress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/test/timer-progress.js b/src/js/test/timer-progress.js index b5ce40d4b..eb93620fc 100644 --- a/src/js/test/timer-progress.js +++ b/src/js/test/timer-progress.js @@ -86,6 +86,7 @@ export function restart() { } export function updateStyle() { + if (!TestLogic.active) return; hide(); update(); setTimeout(() => { @@ -144,7 +145,7 @@ export function update() { } } if (Config.mode === "quote") { - outof = TestLogic.randomQuote.textSplit.length; + outof = TestLogic?.randomQuote?.textSplit?.length ?? 1; } if (Config.timerStyle === "bar") { let percent = Math.floor(