mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 21:09:18 +08:00
fixed timer style switching in the middle of a test not working correctly
This commit is contained in:
parent
13c1b40e13
commit
cd7e771b95
2 changed files with 10 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,14 @@ export function restart() {
|
|||
}
|
||||
}
|
||||
|
||||
export function updateStyle() {
|
||||
hide();
|
||||
update();
|
||||
setTimeout(() => {
|
||||
show();
|
||||
}, 125);
|
||||
}
|
||||
|
||||
export function update() {
|
||||
let time = TestTimer.time;
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue