fixed timer style switching in the middle of a test not working correctly

This commit is contained in:
Miodec 2021-10-12 00:36:12 +01:00
parent 13c1b40e13
commit cd7e771b95
2 changed files with 10 additions and 1 deletions

View file

@ -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();
}

View file

@ -85,6 +85,14 @@ export function restart() {
}
}
export function updateStyle() {
hide();
update();
setTimeout(() => {
show();
}, 125);
}
export function update() {
let time = TestTimer.time;
if (