added login checks before retrieving notification count
This commit is contained in:
parent
a6654ebbf7
commit
c7ac8450b7
|
@ -1,6 +1,7 @@
|
|||
let __notificationCount = '';
|
||||
|
||||
runAfterLoad(() => {
|
||||
retrieveLoginStatus();
|
||||
__notificationCount = getNotificationCount();
|
||||
displayNotificationsInTitle();
|
||||
}, ".*");
|
||||
|
@ -10,8 +11,10 @@ runAfterPathnameChange(() => {
|
|||
}, ".*");
|
||||
|
||||
function getNotificationCount() {
|
||||
if (isLoggedIn) {
|
||||
let menuUserText = document.getElementById('materialize-menu-dropdown').innerText.split('\n')[4];
|
||||
return menuUserText.split(" ")[1] + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
function displayNotificationsInTitle(){
|
||||
|
|
Loading…
Reference in a new issue