mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 11:06:17 +08:00
moved around the loading bar updates
showing loading bar and resetting it to 0 before showing account page closes #3591
This commit is contained in:
parent
4fb91bdfe2
commit
326adb11a0
2 changed files with 8 additions and 2 deletions
|
@ -217,6 +217,7 @@ export async function getDataAndInit(): Promise<boolean> {
|
|||
ResultTagsPopup.updateButtons();
|
||||
Settings.showAccountSection();
|
||||
if (window.location.pathname === "/account") {
|
||||
LoadingPage.updateBar(90);
|
||||
await Account.downloadResults();
|
||||
}
|
||||
if (window.location.pathname === "/login") {
|
||||
|
|
|
@ -898,7 +898,6 @@ function fillContent(): void {
|
|||
|
||||
export async function downloadResults(): Promise<void> {
|
||||
if (DB.getSnapshot().results !== undefined) return;
|
||||
LoadingPage.updateBar(45, true);
|
||||
const results = await DB.getUserResults();
|
||||
TodayTracker.addAllFromToday();
|
||||
if (results) {
|
||||
|
@ -912,6 +911,7 @@ export async function update(): Promise<void> {
|
|||
Notifications.add(`Missing account data. Please refresh.`, -1);
|
||||
$(".pageAccount .preloader").html("Missing account data. Please refresh.");
|
||||
} else {
|
||||
LoadingPage.updateBar(90);
|
||||
await downloadResults();
|
||||
try {
|
||||
fillContent();
|
||||
|
@ -1133,7 +1133,12 @@ export const page = new Page(
|
|||
reset();
|
||||
},
|
||||
async () => {
|
||||
await update();
|
||||
if (DB.getSnapshot().results == undefined) {
|
||||
$(".pageLoading .fill, .pageAccount .fill").css("width", "0%");
|
||||
$(".pageAccount .content").addClass("hidden");
|
||||
$(".pageAccount .preloader").removeClass("hidden");
|
||||
}
|
||||
update();
|
||||
},
|
||||
async () => {
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue