diff --git a/src/js/script.js b/src/js/script.js index 09b14e8a1..b7ab7a5eb 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -1813,7 +1813,7 @@ function showResult(difficultyFailed = false) { ) { $("#result .stats .leaderboards").removeClass("hidden"); $("#result .stats .leaderboards .bottom").html( - `checking` + `checking ` ); } CloudFunctions.testCompleted({ diff --git a/src/js/test/test-leaderboards.js b/src/js/test/test-leaderboards.js index 4c646e961..33521f0ed 100644 --- a/src/js/test/test-leaderboards.js +++ b/src/js/test/test-leaderboards.js @@ -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` + `checking ` + ); + textTimeouts.push( + setTimeout(() => { + $("#result .stats .leaderboards .bottom").html( + `still checking ` + ); + }, 5000) + ); + textTimeouts.push( + setTimeout(() => { + $("#result .stats .leaderboards .bottom").html( + `leaderboard seems
to be very busy ` + ); + }, 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) => {