mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-16 03:28:30 +08:00
fixed bug with setting funbox to none
This commit is contained in:
parent
ecbd6000c3
commit
9847db8720
2 changed files with 8 additions and 5 deletions
|
@ -73,9 +73,8 @@ export function toggleScript(...params) {
|
|||
}
|
||||
|
||||
export async function activate(funbox, mode) {
|
||||
if (funbox === undefined) {
|
||||
if (funbox === undefined || funbox === null) {
|
||||
funbox = funboxSaved;
|
||||
mode = modeSaved;
|
||||
}
|
||||
if (Misc.getCurrentLanguage().ligatures) {
|
||||
if (funbox == "choo_choo" || funbox == "earthquake") {
|
||||
|
@ -95,8 +94,12 @@ export async function activate(funbox, mode) {
|
|||
|
||||
$("#wordsWrapper").removeClass("hidden");
|
||||
// }
|
||||
|
||||
if (mode === null || mode === undefined) {
|
||||
if (funbox === "none" && mode === undefined) {
|
||||
mode = null;
|
||||
} else if (
|
||||
(funbox !== "none" && mode === undefined) ||
|
||||
(funbox !== "none" && mode === null)
|
||||
) {
|
||||
let list = await Misc.getFunboxList();
|
||||
mode = list.filter((f) => f.name === funbox)[0].type;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ export function changePage(page) {
|
|||
TestStats.resetIncomplete();
|
||||
ManualRestart.set();
|
||||
TestLogic.restart();
|
||||
Funbox.activate();
|
||||
Funbox.activate(Funbox.funboxSaved, Funbox.modeSaved);
|
||||
} else if (page == "about") {
|
||||
setPageTransition(true);
|
||||
TestLogic.restart();
|
||||
|
|
Loading…
Add table
Reference in a new issue