diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index 7084d0f0b..bd67a8ac5 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -18,8 +18,13 @@ const userPreferences = () => get(user)?.prefs; const notificationPrefs = (): Record => { const prefs = userPreferences(); + + if (prefs === null) { + return {}; + } + // for some reason, the prefs become array as default or on all clear. let's reset. - return prefs && Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; + return Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; }; function updateNotificationPrefs(parsedPrefs: Record) {