From 6c39ed22a3f92428dfea53eaf75a56c81dc4fddb Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 15 Nov 2024 19:43:48 +0100 Subject: [PATCH] fix: prefs empty array case --- src/lib/helpers/notifications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index bd67a8ac5..cd4b82608 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -24,7 +24,7 @@ const notificationPrefs = (): Record => { } // for some reason, the prefs become array as default or on all clear. let's reset. - return Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; + return Array.isArray(prefs?.notificationPrefs) ? {} : prefs?.notificationPrefs ?? {}; }; function updateNotificationPrefs(parsedPrefs: Record) {