mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-06 05:43:47 +08:00
showing the progress of leaderboard checking
This commit is contained in:
parent
0ac4754c11
commit
4a3d1eb20b
2 changed files with 19 additions and 2 deletions
|
@ -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({
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue