mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 23:56:22 +08:00
parent
2a4ecba9bf
commit
b49d490cc1
2 changed files with 3 additions and 4 deletions
|
@ -2,7 +2,6 @@ import * as Misc from "../misc";
|
|||
import * as Notifications from "../elements/notifications";
|
||||
import * as ManualRestart from "../test/manual-restart-tracker";
|
||||
import * as CustomText from "../test/custom-text";
|
||||
import * as TestLogic from "../test/test-logic";
|
||||
import * as Funbox from "../test/funbox";
|
||||
import Config, * as UpdateConfig from "../config";
|
||||
import * as TestUI from "../test/test-ui";
|
||||
|
@ -167,12 +166,11 @@ export async function setup(challengeName) {
|
|||
if (challenge === undefined) {
|
||||
Notifications.add("Challenge not found", 0);
|
||||
ManualRestart.set();
|
||||
TestLogic.restart(false, true);
|
||||
setTimeout(() => {
|
||||
$("#top .config").removeClass("hidden");
|
||||
$(".page.pageTest").removeClass("hidden");
|
||||
}, 250);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (challenge.type === "customTime") {
|
||||
UpdateConfig.setTimeConfig(challenge.parameters[0], true);
|
||||
|
@ -239,7 +237,6 @@ export async function setup(challengeName) {
|
|||
}
|
||||
}
|
||||
ManualRestart.set();
|
||||
TestLogic.restart(false, true);
|
||||
notitext = challenge.message;
|
||||
$("#top .config").removeClass("hidden");
|
||||
$(".page.pageTest").removeClass("hidden");
|
||||
|
@ -251,6 +248,7 @@ export async function setup(challengeName) {
|
|||
}
|
||||
TestState.setActiveChallenge(challenge);
|
||||
challengeLoading = false;
|
||||
return true;
|
||||
} catch (e) {
|
||||
Notifications.add("Something went wrong: " + e, -1);
|
||||
}
|
||||
|
|
|
@ -2332,6 +2332,7 @@ Misc.getChallengeList().then((challenges) => {
|
|||
display: challenge.display,
|
||||
exec: () => {
|
||||
ChallengeController.setup(challenge.name);
|
||||
TestLogic.restart(false, true);
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue