This commit is contained in:
Miodec 2022-03-15 18:37:04 +01:00
parent 2ed9374d8d
commit 1435c08d33
2 changed files with 6 additions and 4 deletions

View file

@ -1902,10 +1902,8 @@ export function apply(
}
export function reset(): void {
config = {
...DefaultConfig,
};
apply(config);
ConfigEvent.dispatch("fullConfigChange");
apply(DefaultConfig);
saveFullConfigToLocalStorage();
}

View file

@ -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();