mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-11 08:05:56 +08:00
dispatching configApplied event
removes dependency fixes 2 circular dependencies part of #2462
This commit is contained in:
parent
fe38315f24
commit
c55d3318f4
3 changed files with 9 additions and 2 deletions
|
@ -1455,6 +1455,8 @@ export function apply(configObj) {
|
|||
$("#ad_about1").remove();
|
||||
$("#ad_about2").remove();
|
||||
}
|
||||
|
||||
ConfigEvent.dispatch("configApplied", config);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import * as PresetController from "../controllers/preset-controller";
|
|||
import * as ThemePicker from "../settings/theme-picker";
|
||||
import * as ImportExportSettingsPopup from "../popups/import-export-settings-popup";
|
||||
import * as CustomThemePopup from "../popups/custom-theme-popup";
|
||||
import * as ConfigEvent from "./../observables/config-event";
|
||||
import Page from "./page";
|
||||
|
||||
export let groups = {};
|
||||
|
@ -915,6 +916,12 @@ $(".quickNav .links a").on("click", (e) => {
|
|||
isOpen && toggleSettingsGroup(settingsGroup);
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
ConfigEvent.subscribe((eventKey) => {
|
||||
if (eventKey === "configApplied") update();
|
||||
});
|
||||
});
|
||||
|
||||
export const page = new Page(
|
||||
"settings",
|
||||
$(".page.pageSettings"),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import * as UpdateConfig from "../config";
|
||||
import * as Settings from "../pages/settings";
|
||||
import * as Notifications from "../elements/notifications";
|
||||
|
||||
export function show(mode, config) {
|
||||
|
@ -37,7 +36,6 @@ function hide() {
|
|||
);
|
||||
}
|
||||
UpdateConfig.saveToLocalStorage();
|
||||
Settings.update();
|
||||
}
|
||||
$("#settingsImportWrapper")
|
||||
.stop(true, true)
|
||||
|
|
Loading…
Add table
Reference in a new issue