From b402cf7f10ec7aa3bd66417c056f231cd12ba185 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Fri, 21 Feb 2025 10:49:14 +0100 Subject: [PATCH] fix: add return type --- utils/recently-added-notifications.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/recently-added-notifications.ts b/utils/recently-added-notifications.ts index 5a551404..20a5304f 100644 --- a/utils/recently-added-notifications.ts +++ b/utils/recently-added-notifications.ts @@ -66,7 +66,7 @@ export async function fetchAndStoreRecentlyAdded( userId: string, basePath: string, token: string -) { +): Promise { try { const deviceName = await getDeviceName(); const id = getOrSetDeviceId(); @@ -153,7 +153,7 @@ export async function fetchAndStoreRecentlyAdded( RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY, JSON.stringify(items.map((item) => item.Id)) ); - return; + return 0; } else { // Only send notifications for items that haven't been sent yet for (const newItem of items) { @@ -176,8 +176,12 @@ export async function fetchAndStoreRecentlyAdded( RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY, JSON.stringify([...new Set([...alreadySentItemIds, ...newIds])]) ); + + return newIds.length; } } catch (error) { console.error("Error fetching recently added items:", error); } + + return 0; }