From cd7e771b95a209f9d40ce206be65cdfcd706e8c5 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 12 Oct 2021 00:36:12 +0100 Subject: [PATCH] fixed timer style switching in the middle of a test not working correctly --- src/js/config.js | 3 ++- src/js/test/timer-progress.js | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/js/config.js b/src/js/config.js index 00de4d702..7f4b182fd 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -830,7 +830,7 @@ export function setShowTimerProgress(timer, nosave) { timer = false; } config.showTimerProgress = timer; - if (config.showTimerProgress) { + if (config.showTimerProgress && TestLogic.active) { TimerProgress.show(); } else { TimerProgress.hide(); @@ -961,6 +961,7 @@ export function setTimerStyle(style, nosave) { style = "mini"; } config.timerStyle = style; + TimerProgress.updateStyle(); if (!nosave) saveToLocalStorage(); } diff --git a/src/js/test/timer-progress.js b/src/js/test/timer-progress.js index b38a39da6..b5ce40d4b 100644 --- a/src/js/test/timer-progress.js +++ b/src/js/test/timer-progress.js @@ -85,6 +85,14 @@ export function restart() { } } +export function updateStyle() { + hide(); + update(); + setTimeout(() => { + show(); + }, 125); +} + export function update() { let time = TestTimer.time; if (