showing the progress of leaderboard checking

This commit is contained in:
Miodec 2021-03-18 02:31:19 +00:00
parent 0ac4754c11
commit 4a3d1eb20b
2 changed files with 19 additions and 2 deletions

View file

@ -1813,7 +1813,7 @@ function showResult(difficultyFailed = false) {
) {
$("#result .stats .leaderboards").removeClass("hidden");
$("#result .stats .leaderboards .bottom").html(
`checking<i class="fas fa-spin fa-fw fa-circle-notch"></i>`
`checking <i class="fas fa-spin fa-fw fa-circle-notch"></i>`
);
}
CloudFunctions.testCompleted({

View file

@ -4,6 +4,8 @@ import * as Notifications from "./notification-center";
import Config from "./config";
import * as Misc from "./misc";
let textTimeouts = [];
export function check(completedEvent) {
try {
if (
@ -14,7 +16,21 @@ export function check(completedEvent) {
) {
$("#result .stats .leaderboards").removeClass("hidden");
$("#result .stats .leaderboards .bottom").html(
`checking<i class="fas fa-spin fa-fw fa-circle-notch"></i>`
`checking <i class="fas fa-spin fa-fw fa-circle-notch"></i>`
);
textTimeouts.push(
setTimeout(() => {
$("#result .stats .leaderboards .bottom").html(
`still checking <i class="fas fa-spin fa-fw fa-circle-notch"></i>`
);
}, 5000)
);
textTimeouts.push(
setTimeout(() => {
$("#result .stats .leaderboards .bottom").html(
`leaderboard seems<br>to be very busy <i class="fas fa-spin fa-fw fa-circle-notch"></i>`
);
}, 10000)
);
let lbRes = completedEvent;
delete lbRes.keySpacing;
@ -31,6 +47,7 @@ export function check(completedEvent) {
result: lbRes,
})
.then((data) => {
Misc.clearTimeouts(textTimeouts);
show(data.data, completedEvent.mode2);
})
.catch((e) => {