added variable to disable config event

fixes lag when applying config
This commit is contained in:
Miodec 2022-02-11 18:11:04 +01:00
parent c8b3852739
commit 8542dcc9b8

View file

@ -815,7 +815,9 @@ $(document).on(
let target = e.currentTarget;
let presetid = $(target).parent(".preset").attr("id");
console.log("Applying Preset");
configEventDisabled = true;
PresetController.apply(presetid);
configEventDisabled = false;
update();
}
);
@ -917,7 +919,9 @@ $(".quickNav .links a").on("click", (e) => {
isOpen && toggleSettingsGroup(settingsGroup);
});
let configEventDisabled = false;
ConfigEvent.subscribe(() => {
if (configEventDisabled) return;
if (ActivePage.get() === "settings") update();
});