Fix double transition of loader backdrop

This commit is contained in:
Wolfsblvt 2024-06-30 22:17:23 +02:00
parent 5c318cd3f3
commit 5a8973d12a

View File

@ -23,26 +23,23 @@ export function showLoader() {
}
export async function hideLoader() {
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
// If it's present, we remove it once and then it's gone.
yoinkPreloader();
if (!loaderPopup) {
console.warn('There is no loader showing to hide');
return Promise.resolve();
}
return new Promise((resolve) => {
//Sets up a 2-step animation. Spinner blurs/fades out, and then the loader shadow does the same.
//Sets up a 2-step animation. Spinner blurs/fades out, and then the loader shadow does the same (by utilizing the popup closing transition)
$('#load-spinner').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
$(`#${ELEMENT_ID}`)
//only fade out the spinner and replace with login screen
.animate({ opacity: 0 }, 300, function () {
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
// If it's present, we remove it once and then it's gone.
yoinkPreloader();
$(`#${ELEMENT_ID}`).remove();
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
loaderPopup = null;
resolve();
});
});
$(`#${ELEMENT_ID}`).remove();
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
loaderPopup = null;
resolve();
});
});
$('#load-spinner')