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