From 511a4c62277e21a194d333b589cbde4e59ef5861 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Thu, 3 Oct 2024 13:24:15 +0530 Subject: [PATCH] fix: promo cancels not working. --- src/lib/helpers/notifications.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index 306a80995..e5f9ae143 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -18,7 +18,8 @@ const userPreferences = () => get(user).prefs; const notificationPrefs = (): Record => { const prefs = userPreferences(); - return prefs.notificationPrefs ? prefs.notificationPrefs : {}; + // for some reason, the prefs become array as default or on all clear. let's reset. + return Array.isArray(prefs.notificationPrefs) ? {} : prefs.notificationPrefs || {}; }; function updateNotificationPrefs(parsedPrefs: Record) {