mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 05:03:39 +08:00
parent
90d4fed59e
commit
ca58c9e6f6
2 changed files with 14 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import * as DB from "./db";
|
||||
import * as Sound from "./controllers/sound-controller";
|
||||
import * as OutOfFocus from "./test/out-of-focus";
|
||||
import * as TimerProgress from "./test/timer-progress";
|
||||
import * as LiveWpm from "./test/live-wpm";
|
||||
import * as LiveAcc from "./test/live-acc";
|
||||
import * as LiveBurst from "./test/live-burst";
|
||||
|
|
@ -680,11 +679,6 @@ export function setShowTimerProgress(timer, nosave) {
|
|||
timer = false;
|
||||
}
|
||||
config.showTimerProgress = timer;
|
||||
if (config.showTimerProgress && TestLogic.active) {
|
||||
TimerProgress.show();
|
||||
} else {
|
||||
TimerProgress.hide();
|
||||
}
|
||||
if (!nosave) saveToLocalStorage();
|
||||
dispatchEvent("showTimerProgress", config.showTimerProgress);
|
||||
}
|
||||
|
|
@ -770,7 +764,6 @@ export function setTimerStyle(style, nosave) {
|
|||
style = "mini";
|
||||
}
|
||||
config.timerStyle = style;
|
||||
TimerProgress.updateStyle();
|
||||
if (!nosave) saveToLocalStorage();
|
||||
dispatchEvent("timerStyle", config.timerStyle);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import Config from "../config";
|
||||
import Config, * as UpdateConfig from "../config";
|
||||
import * as CustomText from "./custom-text";
|
||||
import * as Misc from "../misc";
|
||||
import * as TestLogic from "./test-logic";
|
||||
|
|
@ -189,3 +189,16 @@ export function updateStyle() {
|
|||
show();
|
||||
}, 125);
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
UpdateConfig.subscribeToEvent((eventKey, eventValue) => {
|
||||
if (eventKey === "showTimerProgress") {
|
||||
if (eventValue === true && TestLogic.active) {
|
||||
show();
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
if (eventKey === "timerStyle") updateStyle();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue