Skip to content

Invidious is an alternative front-end to YouTube

Get a count of 0 if STORAGE_KEY_NOTIF_COUNT is not present in storage

fieryhenry3335bc8c3886
diff --git a/assets/js/notifications.js b/assets/js/notifications.js
index b8d73a82..16d9866d 100644
--- a/assets/js/notifications.js
+++ b/assets/js/notifications.js
@@ -77,7 +77,7 @@ function create_notification_stream(subscriptions) {
function update_ticker_count() {
var notification_ticker = document.getElementById('notification_ticker');
- const notification_count = helpers.storage.get(STORAGE_KEY_NOTIF_COUNT);
+ const notification_count = helpers.storage.get(STORAGE_KEY_NOTIF_COUNT) || 0;
if (notification_count > 0) {
notification_ticker.innerHTML =
'<span id="notification_count">' + notification_count + '</span> <i class="icon ion-ios-notifications"></i>';