mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-11 06:05:16 +08:00
fixed challenge loading
This commit is contained in:
parent
12fe19a3c2
commit
6be52ea845
3 changed files with 17 additions and 9 deletions
|
@ -308,6 +308,7 @@ firebase.auth().onAuthStateChanged(function (user) {
|
|||
setCustomThemeInputs();
|
||||
}
|
||||
if (/challenge_.+/g.test(window.location.pathname)) {
|
||||
Notifications.add("Loading challenge", 0);
|
||||
let challengeName = window.location.pathname.split("_")[1];
|
||||
setTimeout(() => {
|
||||
setupChallenge(challengeName);
|
||||
|
|
|
@ -1353,7 +1353,7 @@ function showResult(difficultyFailed = false) {
|
|||
}
|
||||
|
||||
if (difficultyFailed) {
|
||||
Notifications.add("Test failed", 0);
|
||||
Notifications.add("Test failed", 0, 1);
|
||||
} else if (afkDetected) {
|
||||
Notifications.add("Test invalid - AFK detected", 0);
|
||||
} else if (sameWordset) {
|
||||
|
@ -4517,7 +4517,14 @@ async function setupChallenge(challengeName) {
|
|||
let notitext;
|
||||
try {
|
||||
if (challenge === undefined) {
|
||||
throw "Challenge not found";
|
||||
Notifications.add("Challenge not found", 0);
|
||||
ManualRestart.set();
|
||||
restartTest(false, true);
|
||||
setTimeout(() => {
|
||||
$("#top .config").removeClass("hidden");
|
||||
$(".page.pageTest").removeClass("hidden");
|
||||
}, 250);
|
||||
return;
|
||||
}
|
||||
if (challenge.type === "customTime") {
|
||||
setTimeConfig(challenge.parameters[0], true);
|
||||
|
|
|
@ -31,27 +31,27 @@
|
|||
}
|
||||
,{
|
||||
"name": "trueSimp",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["miodec",true,10000]
|
||||
}
|
||||
,{
|
||||
"name": "simp",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["miodec",true,1000]
|
||||
}
|
||||
,{
|
||||
"name": "antidiseWhat",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["antidisestablishmentarianism",true,1]
|
||||
}
|
||||
,{
|
||||
"name": "whatsThisWebsiteCalledAgain",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["monkeytype",true,1000]
|
||||
}
|
||||
,{
|
||||
"name": "developd",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["develop",true,1000]
|
||||
}
|
||||
,{
|
||||
|
@ -61,12 +61,12 @@
|
|||
}
|
||||
,{
|
||||
"name": "speedSpacer",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["a b c d e f g h i j k l m n o p q r s t u v w x y z",true,100]
|
||||
}
|
||||
,{
|
||||
"name": "iveGotThePower",
|
||||
"type": "CustomText",
|
||||
"type": "customText",
|
||||
"parameters": ["power",true,10]
|
||||
}
|
||||
,{
|
||||
|
|
Loading…
Reference in a new issue