From de4e8729969e7d139b7faeeb6e136fa68d82f4a3 Mon Sep 17 00:00:00 2001 From: Leonabcd123 <156839416+Leonabcd123@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:09:30 +0200 Subject: [PATCH] fix(lazy-mode): Save lazy mode in local storage after getting not supported message (@Leonabcd123) (#7171) ### Description Save lazy mode status in local storage after getting the "This language does not support lazy mode" message. This is so the user doesn't get the same message every time they refresh, and it matches up with the settings that show that lazy mode is disabled even though it's enabled in local storage. --- frontend/src/ts/test/test-logic.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/test/test-logic.ts b/frontend/src/ts/test/test-logic.ts index 7e18d3527..824b86d48 100644 --- a/frontend/src/ts/test/test-logic.ts +++ b/frontend/src/ts/test/test-logic.ts @@ -400,6 +400,7 @@ export function restart(options = {} as RestartOptions): void { let lastInitError: Error | null = null; let rememberLazyMode: boolean; +let showedLazyModeNotification: boolean = false; let testReinitCount = 0; async function init(): Promise { @@ -494,7 +495,7 @@ async function init(): Promise { important: true, }, ); - UpdateConfig.setLazyMode(false, true); + UpdateConfig.setLazyMode(false, false); } else if (rememberLazyMode && anySupportsLazyMode) { UpdateConfig.setLazyMode(true, true); } @@ -502,10 +503,12 @@ async function init(): Promise { // normal mode if (Config.lazyMode && !allowLazyMode) { rememberLazyMode = true; + showedLazyModeNotification = true; Notifications.add("This language does not support lazy mode.", 0, { important: true, }); - UpdateConfig.setLazyMode(false, true); + + UpdateConfig.setLazyMode(false, false); } else if (rememberLazyMode && !language.noLazyMode) { UpdateConfig.setLazyMode(true, true); } @@ -1627,7 +1630,10 @@ ConfigEvent.subscribe((eventKey, eventValue, nosave) => { ArabicLazyMode.set(eventValue as boolean); } if (eventValue === false) { - rememberLazyMode = false; + if (!showedLazyModeNotification) { + rememberLazyMode = false; + } + showedLazyModeNotification = false; } } });