added login checks before retrieving notification count

This commit is contained in:
kaffem 2020-08-20 16:14:07 +02:00
parent a6654ebbf7
commit c7ac8450b7

View file

@ -1,6 +1,7 @@
let __notificationCount = '';
runAfterLoad(() => {
retrieveLoginStatus();
__notificationCount = getNotificationCount();
displayNotificationsInTitle();
}, ".*");
@ -10,8 +11,10 @@ runAfterPathnameChange(() => {
}, ".*");
function getNotificationCount() {
let menuUserText = document.getElementById('materialize-menu-dropdown').innerText.split('\n')[4];
return menuUserText.split(" ")[1] + ' ';
if (isLoggedIn) {
let menuUserText = document.getElementById('materialize-menu-dropdown').innerText.split('\n')[4];
return menuUserText.split(" ")[1] + ' ';
}
}
function displayNotificationsInTitle(){