diff --git a/extension/content.css b/extension/content.css index f71aa52..40a2627 100644 --- a/extension/content.css +++ b/extension/content.css @@ -646,11 +646,6 @@ div.inline-comment-form .form-actions, margin-top: 5px; } -/* Display notification bell icon for bookmarked Issues/PR */ -.notification-indicator .mail-status.local-unread{ - display: inline-block; -} - /* Decrease the size of the search box to fit 'Yours' menu item */ .subnav-search-input[aria-label="Search all issues"] { width: 420px; diff --git a/src/libs/mark-unread.js b/src/libs/mark-unread.js index cb60213..14be56a 100644 --- a/src/libs/mark-unread.js +++ b/src/libs/mark-unread.js @@ -236,11 +236,11 @@ function getUserName() { function unreadIndicatorIcon() { const notificationIndicator = select('.header-nav-link.notification-indicator'); const notificationStatus = notificationIndicator.querySelector('.mail-status'); + const hasUnread = select.exists('li.js-notification.unread') || loadNotifications().length > 0; + const label = hasUnread ? 'You have unread notifications' : 'You have no unread notifications'; - if (loadNotifications().length > 0) { - notificationStatus.classList.add('local-unread'); - notificationIndicator.setAttribute('aria-label', 'You have unread notifications'); - } + notificationStatus.classList.toggle('unread', hasUnread); + notificationIndicator.setAttribute('aria-label', label); } function markNotificationRead(e) {