From a6654ebbf760eb99ce01a425451c7348056146c3 Mon Sep 17 00:00:00 2001 From: kaffem <29717789+kaffem@users.noreply.github.com> Date: Thu, 20 Aug 2020 16:09:08 +0200 Subject: [PATCH] simplified retrieving the notification count --- enhancements/notifications.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/enhancements/notifications.js b/enhancements/notifications.js index c6c984f..c3db45e 100644 --- a/enhancements/notifications.js +++ b/enhancements/notifications.js @@ -10,10 +10,8 @@ runAfterPathnameChange(() => { }, ".*"); function getNotificationCount() { - let menu = document.getElementById('materialize-menu-dropdown'); - let menuDropdowns = Array.from(menu.querySelectorAll('ul.dropdown')).slice(-1)[0]; - let notificationText = menuDropdowns.innerText.split(" ")[3]; - return notificationText.split(" ")[1] + ' '; + let menuUserText = document.getElementById('materialize-menu-dropdown').innerText.split('\n')[4]; + return menuUserText.split(" ")[1] + ' '; } function displayNotificationsInTitle(){