From 1435c08d330c913720bd03bc4f5112b246f877ef Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 15 Mar 2022 18:37:04 +0100 Subject: [PATCH] fixed #2709 --- frontend/src/scripts/config.ts | 6 ++---- frontend/src/scripts/pages/settings.ts | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/scripts/config.ts b/frontend/src/scripts/config.ts index c4fd6cf76..5d2704d58 100644 --- a/frontend/src/scripts/config.ts +++ b/frontend/src/scripts/config.ts @@ -1902,10 +1902,8 @@ export function apply( } export function reset(): void { - config = { - ...DefaultConfig, - }; - apply(config); + ConfigEvent.dispatch("fullConfigChange"); + apply(DefaultConfig); saveFullConfigToLocalStorage(); } diff --git a/frontend/src/scripts/pages/settings.ts b/frontend/src/scripts/pages/settings.ts index 5dd5fb262..7999599fa 100644 --- a/frontend/src/scripts/pages/settings.ts +++ b/frontend/src/scripts/pages/settings.ts @@ -1033,6 +1033,10 @@ export function setEventDisabled(value: boolean): void { configEventDisabled = value; } ConfigEvent.subscribe((eventKey) => { + if (eventKey === "fullConfigChange") setEventDisabled(true); + if (eventKey === "fullConfigChangeFinished") { + setEventDisabled(false); + } if (configEventDisabled || eventKey === "saveToLocalStorage") return; if (ActivePage.get() === "settings" && eventKey !== "theme") { update();