From 79d46f8bec965a692f75eb900334ae20d4c15328 Mon Sep 17 00:00:00 2001 From: ItzNotABug Date: Wed, 18 Sep 2024 12:55:17 +0530 Subject: [PATCH] update: use options like logic for notifications. --- src/lib/helpers/notifications.ts | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/lib/helpers/notifications.ts b/src/lib/helpers/notifications.ts index f54073fe7..a13d3a95d 100644 --- a/src/lib/helpers/notifications.ts +++ b/src/lib/helpers/notifications.ts @@ -8,6 +8,12 @@ type NotificationPrefItem = { state: 'hidden' | 'shown' | undefined; }; +export type NotificationCoolOffOptions = { + coolOffPeriod?: number; + exponentialBackoff?: boolean; + exponentialBackoffFactor?: number; +}; + const userPreferences = () => get(user).prefs; const notificationPrefs = (): Record => { @@ -31,14 +37,18 @@ function updateNotificationPrefs(parsedPrefs: Record