fixed challenge loading

This commit is contained in:
Miodec 2021-03-20 16:03:31 +00:00
parent 12fe19a3c2
commit 6be52ea845
3 changed files with 17 additions and 9 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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]
}
,{