mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
fixed challenges clearing themselves when loaded. closes #1790
This commit is contained in:
parent
cf32d1999a
commit
a7b2a5d442
|
@ -6,11 +6,13 @@ import * as TestLogic from "./test-logic";
|
|||
import * as Funbox from "./funbox";
|
||||
import Config, * as UpdateConfig from "./config";
|
||||
import * as UI from "./ui";
|
||||
import * as TestUI from "./test-ui";
|
||||
|
||||
export let active = null;
|
||||
let challengeLoading = false;
|
||||
|
||||
export function clearActive() {
|
||||
if (active) {
|
||||
if (active && !challengeLoading && !TestUI.testRestarting) {
|
||||
Notifications.add("Challenge cleared", 0);
|
||||
active = null;
|
||||
}
|
||||
|
@ -125,6 +127,7 @@ export function verify(result) {
|
|||
}
|
||||
|
||||
export async function setup(challengeName) {
|
||||
challengeLoading = true;
|
||||
if (!$(".page.pageTest").hasClass("active")) {
|
||||
UI.changePage("", true);
|
||||
}
|
||||
|
@ -219,6 +222,7 @@ export async function setup(challengeName) {
|
|||
Notifications.add("Challenge loaded. " + notitext, 0);
|
||||
}
|
||||
active = challenge;
|
||||
challengeLoading = false;
|
||||
} catch (e) {
|
||||
Notifications.add("Something went wrong: " + e, -1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue