From ef851ae3f5e3cbaa3facb65d71fdb386e8260f22 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Fri, 21 Feb 2025 13:29:40 +0100 Subject: [PATCH] chore: debugging counter --- app/_layout.tsx | 3 +++ components/settings/RecentlyAddedNotifications.tsx | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/app/_layout.tsx b/app/_layout.tsx index fd71bec4..dba18901 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -111,6 +111,9 @@ if (!Platform.isTV) { const url = getServerUrlFromStorage(); const user = getUserFromStorage(); + const c = storage.getNumber("notification_send_for_item_ids.count"); + storage.set("notification_send_for_item_ids.count", (c || 0) + 1); + console.log( "TaskManager ~ trigger ~ recently added notifications:", token, diff --git a/components/settings/RecentlyAddedNotifications.tsx b/components/settings/RecentlyAddedNotifications.tsx index a4ef2040..e654ad6c 100644 --- a/components/settings/RecentlyAddedNotifications.tsx +++ b/components/settings/RecentlyAddedNotifications.tsx @@ -9,6 +9,7 @@ import { storage } from "@/utils/mmkv"; import { RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY } from "@/utils/recently-added-notifications"; import * as TaskManager from "expo-task-manager"; import * as BackgroundFetch from "expo-background-fetch"; +import { useMMKVNumber } from "react-native-mmkv"; export const RecentlyAddedNotificationsSettings: React.FC = ({ ...props }) => { const [settings, updateSettings] = useSettings(); @@ -28,6 +29,10 @@ export const RecentlyAddedNotificationsSettings: React.FC = ({ ...props }) => { } }, []); + const [triggerCount, setTriggerCount] = useMMKVNumber( + "notification_send_for_item_ids.count" + ); + return ( @@ -39,6 +44,7 @@ export const RecentlyAddedNotificationsSettings: React.FC = ({ ...props }) => { } /> +