mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-25 07:17:23 +08:00
subscribing to config event
fixes 8 circular dependencies part of #2462
This commit is contained in:
parent
ef3b1d2393
commit
7b6d02ba8d
2 changed files with 6 additions and 2 deletions
|
|
@ -6,7 +6,6 @@ import * as LanguagePicker from "./settings/language-picker";
|
|||
import * as BackgroundFilter from "./elements/custom-background-filter";
|
||||
import LayoutList from "./test/layouts";
|
||||
import * as TTS from "./test/tts";
|
||||
import * as PractiseWords from "./test/practise-words";
|
||||
|
||||
export let localStorageConfig = null;
|
||||
export let dbConfigLoaded = false;
|
||||
|
|
@ -208,7 +207,6 @@ export function setMode(mode, nosave) {
|
|||
Notifications.add(`Pace caret will not work with zen mode.`, 0);
|
||||
}
|
||||
}
|
||||
PractiseWords.resetBefore();
|
||||
if (!nosave) saveToLocalStorage();
|
||||
dispatchEvent("mode", previous, config.mode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,3 +163,9 @@ $("#practiseWordsPopup .button.both").on("focusout", (e) => {
|
|||
e.preventDefault();
|
||||
$("#practiseWordsPopup .missed").focus();
|
||||
});
|
||||
|
||||
$(document).ready(() => {
|
||||
UpdateConfig.subscribeToEvent((eventKey) => {
|
||||
if (eventKey === "mode") resetBefore();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue