From dde90f829c4f7f9d91281df33583fee6b2cdb2c2 Mon Sep 17 00:00:00 2001 From: Saint-dev Date: Mon, 5 Apr 2021 13:59:05 -0400 Subject: [PATCH] re-added funbox notification --- src/js/test/funbox.js | 8 ++++++++ src/js/test/test-logic.js | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/js/test/funbox.js b/src/js/test/funbox.js index cf6b6bf47..d696966bb 100644 --- a/src/js/test/funbox.js +++ b/src/js/test/funbox.js @@ -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; } diff --git a/src/js/test/test-logic.js b/src/js/test/test-logic.js index 0daa0e0ed..e5dd6f327 100644 --- a/src/js/test/test-logic.js +++ b/src/js/test/test-logic.js @@ -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(); }