mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 20:40:48 +08:00
added variable to disable config event
fixes lag when applying config
This commit is contained in:
parent
c8b3852739
commit
8542dcc9b8
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue