fix: prefs empty array case

This commit is contained in:
Torsten Dittmann committed 2024-11-15 19:43:48 +01:00
1 parent ac7b527260
commit 6c39ed22a3
1 file changed
+1 -1
+1 -1
View File
@@ -24,7 +24,7 @@ const notificationPrefs = (): Record<string, NotificationPrefItem> => {
}
// 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<string, NotificationPrefItem>) {