re-added funbox notification

This commit is contained in:
Saint-dev 2021-04-05 13:59:05 -04:00
parent a2b7aa281c
commit dde90f829c
2 changed files with 9 additions and 5 deletions

View file

@ -162,7 +162,15 @@ export async function activate(funbox, mode) {
return true;
}
export function setFunbox(funbox, mode) {
if (TestLogic.active || TestUI.resultVisible) {
Notifications.add(
"You can only change the funbox before starting a test.",
0
);
return false;
}
funboxSaved = funbox;
modeSaved = mode;
active = funbox;
return true;
}

View file

@ -314,6 +314,7 @@ export function startTest() {
LiveAcc.show();
TimerProgress.update(TestTimer.time);
TestTimer.clear();
if (Funbox.active === "memory") {
Funbox.resetMemoryTimer();
$("#wordsWrapper").addClass("hidden");
@ -574,14 +575,10 @@ export async function init() {
// $("#wordsWrapper").css("height", "auto");
// } else {
TestUI.showWords();
// if($(".page.active").attr("class") === $(".page.pageTest")){
// Funbox.activate();
// }
if ($(".pageTest").hasClass("active")) {
Funbox.activate();
}
// }
}
export function restart(withSameWordset = false, nosave = false, event) {
@ -630,7 +627,6 @@ export function restart(withSameWordset = false, nosave = false, event) {
// restartCount++;
}
if (Config.mode == "zen") {
$("#words").empty();
}