fixed bug with setting funbox to none

This commit is contained in:
Saint-dev 2021-04-08 13:53:29 -04:00
parent ecbd6000c3
commit 9847db8720
2 changed files with 8 additions and 5 deletions

View file

@ -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;
}

View file

@ -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();