Skip to content

Commit 3b63024

Browse files
committed
Hide loader fixes
1 parent db48f4d commit 3b63024

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/clicker/clicker.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ try {
342342
storage.set("makeUpDate", null);
343343
auth.syncPush("makeUpDate");
344344
ui.view("");
345+
ui.stopLoader();
345346
});
346347

347348
// Submit to Google Forms
@@ -440,6 +441,7 @@ try {
440441
{
441442
text: "Continue Anyway",
442443
close: true,
444+
onclick: ui.stopLoader,
443445
},
444446
]);
445447
} else if (matchesCurrentPeriod && storage.get("makeUpDate")) {
@@ -452,11 +454,13 @@ try {
452454
auth.syncPush("makeUpDate");
453455
ui.updateTitles();
454456
ui.view("");
457+
ui.stopLoader();
455458
},
456459
},
457460
{
458461
text: "Continue Anyway",
459462
close: true,
463+
onclick: ui.stopLoader,
460464
},
461465
]);
462466
}
@@ -557,7 +561,6 @@ try {
557561
});
558562
} catch (error) {
559563
console.error(error);
560-
ui.view("api-fail");
561564
}
562565
}
563566

src/modules/auth.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export async function sync(hideWelcome = true, returnFunction = null) {
6262
continueWithoutAPIButton.addEventListener("click", () => {
6363
ui.view();
6464
returnFunction();
65-
ui.stopLoader();
6665
const newContinueWithoutAPIButton = continueWithoutAPIButton.cloneNode(true);
6766
continueWithoutAPIButton.parentNode.replaceChild(newContinueWithoutAPIButton, continueWithoutAPIButton);
6867
});

src/modules/ui.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,12 @@ export function view(path = "") {
397397
});
398398
}
399399
const previous = pages.slice(0, pages.length - 1).join("/");
400-
const buttons = (title === 'API Offline') ? [] : [
400+
const buttons = (path === "api-fail") ? [] : [
401401
{
402402
text: `<i class="bi bi-x-lg"></i>`,
403403
class: "icon",
404404
close: true,
405+
onclick: stopLoader,
405406
},
406407
];
407408
if (previous) {
@@ -442,6 +443,7 @@ export function view(path = "") {
442443
document.getElementById("date-input").focus();
443444
}
444445
updateTitles();
446+
stopLoader();
445447
});
446448
const dismissMmakeupClickButton = document.getElementById("dismiss-makeup-button");
447449
const newDismissMmakeupClickButton = dismissMmakeupClickButton.cloneNode(true);
@@ -451,6 +453,7 @@ export function view(path = "") {
451453
auth.syncPush("makeUpDate");
452454
updateTitles();
453455
view("");
456+
stopLoader();
454457
});
455458
}
456459
const event = new Event("view");

0 commit comments

Comments
 (0)