only reacting to config events when test page is active

fixes #2876
This commit is contained in:
Miodec 2022-04-25 17:03:29 +02:00
parent a4ee31a4bb
commit 028e155be9

View file

@ -1735,10 +1735,12 @@ $(document).on("click", "#top #menu #startTestButton, #top .logo", () => {
// ===============================
ConfigEvent.subscribe((eventKey, eventValue, nosave) => {
if (eventKey === "difficulty" && !nosave) restart(false, nosave);
if (eventKey === "showAllLines" && !nosave) restart(false, nosave);
if (eventKey === "keymapMode" && !nosave) restart(false, nosave);
if (eventKey === "tapeMode" && !nosave) restart(false, nosave);
if (ActivePage.get() === "test") {
if (eventKey === "difficulty" && !nosave) restart(false, nosave);
if (eventKey === "showAllLines" && !nosave) restart(false, nosave);
if (eventKey === "keymapMode" && !nosave) restart(false, nosave);
if (eventKey === "tapeMode" && !nosave) restart(false, nosave);
}
if (eventKey === "lazyMode" && eventValue === false && !nosave) {
rememberLazyMode = false;
}