checking if test is active before updating style

catching errors and defaulting to 1
This commit is contained in:
Jack 2021-10-13 19:38:47 +01:00
parent f92bad64be
commit ad3fe3b3e6

View file

@ -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(