mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
making sure you cant switch out of or to the challenge themes during or after the test
This commit is contained in:
parent
7f3acbb8f3
commit
3fc397a6f6
1 changed files with 15 additions and 0 deletions
|
@ -532,10 +532,25 @@ function setMaxConfidence(mc, nosave) {
|
|||
}
|
||||
|
||||
function previewTheme(name) {
|
||||
if (
|
||||
(testActive || resultVisible) &&
|
||||
(config.theme === "nausea" || config.theme === "round_round_baby")
|
||||
)
|
||||
return;
|
||||
if (resultVisible && (name === "nausea" || name === "round_round_baby"))
|
||||
return;
|
||||
$("#currentTheme").attr("href", `themes/${name}.css`);
|
||||
}
|
||||
|
||||
function setTheme(name, nosave) {
|
||||
if (
|
||||
(testActive || resultVisible) &&
|
||||
(config.theme === "nausea" || config.theme === "round_round_baby")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (resultVisible && (name === "nausea" || name === "round_round_baby"))
|
||||
return;
|
||||
config.theme = name;
|
||||
$("#currentTheme").attr("href", `themes/${name}.css`);
|
||||
setTimeout(() => {
|
||||
|
|
Loading…
Reference in a new issue