mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 17:56:09 +08:00
refactor: move ui code out of the config module
This commit is contained in:
parent
45235c134b
commit
2ba1ab8362
2 changed files with 10 additions and 5 deletions
|
|
@ -1205,11 +1205,6 @@ export function setQuickRestartMode(
|
|||
return false;
|
||||
}
|
||||
|
||||
if (mode === "off") {
|
||||
$(".pageTest #restartTestButton").removeClass("hidden");
|
||||
} else {
|
||||
$(".pageTest #restartTestButton").addClass("hidden");
|
||||
}
|
||||
config.quickRestart = mode;
|
||||
saveToLocalStorage("quickRestart", nosave);
|
||||
ConfigEvent.dispatch("quickRestart", config.quickRestart);
|
||||
|
|
|
|||
|
|
@ -1326,3 +1326,13 @@ $(document).on("keypress", () => {
|
|||
skipXpBreakdown();
|
||||
}
|
||||
});
|
||||
|
||||
ConfigEvent.subscribe((key, value) => {
|
||||
if (key === "quickRestart") {
|
||||
if (value === "off") {
|
||||
$(".pageTest #restartTestButton").removeClass("hidden");
|
||||
} else {
|
||||
$(".pageTest #restartTestButton").addClass("hidden");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue