changing the icon and removing the preloader if download failed

This commit is contained in:
Jack 2020-10-06 17:16:47 +01:00
parent 5c6036a028
commit 9da38ba19a
2 changed files with 5 additions and 0 deletions

View file

@ -335,6 +335,8 @@ function getAccountDataAndInit() {
accountIconLoading(false);
console.error(e);
showNotification("Error downloading user data. Refresh to try again. If error persists contact Miodec.", 5000);
$("#top #menu .account .icon").html('<i class="fas fa-fw fa-times"></i>');
$("#top #menu .account").css('opacity', 1);
});
}
@ -2332,6 +2334,7 @@ function refreshAccountPage() {
}
if (dbSnapshot === null) {
showNotification(`Missing account data. Please refresh.`, 5000);
$('.pageAccount .preloader').html('Missing account data. Please refresh.');
}else if (dbSnapshot.results === undefined) {
db_getUserResults().then((d) => {
if (d) {

View file

@ -3055,8 +3055,10 @@ function accountIconLoading(truefalse) {
$("#top #menu .account .icon").html(
'<i class="fas fa-fw fa-spin fa-circle-notch"></i>'
);
$("#top #menu .account").css('opacity',1);
} else {
$("#top #menu .account .icon").html('<i class="fas fa-fw fa-user"></i>');
$("#top #menu .account").css('opacity',1);
}
}