mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 17:34:24 +08:00
refactor: move test restarting to the config event observer
This commit is contained in:
parent
5ce886677b
commit
e1b8424070
2 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import * as UpdateConfig from "../../config";
|
||||
import * as TestLogic from "../../test/test-logic";
|
||||
import { capitalizeFirstLetterOfEachWord } from "../../utils/misc";
|
||||
|
||||
const subgroup: MonkeyTypes.CommandsSubgroup = {
|
||||
|
|
@ -31,7 +30,6 @@ function update(languages: string[]): void {
|
|||
configValue: language,
|
||||
exec: (): void => {
|
||||
UpdateConfig.setLanguage(language);
|
||||
TestLogic.restart();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1519,6 +1519,9 @@ $("header").on("click", "nav #startTestButton, #logo", () => {
|
|||
|
||||
ConfigEvent.subscribe((eventKey, eventValue, nosave) => {
|
||||
if (ActivePage.get() === "test") {
|
||||
if (eventKey === "language") {
|
||||
restart();
|
||||
}
|
||||
if (eventKey === "difficulty" && !nosave) restart();
|
||||
if (eventKey === "showAllLines" && !nosave) restart();
|
||||
if (eventKey === "tapeMode" && !nosave) restart();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue