diff --git a/components/settings/StorageSettings.tsx b/components/settings/StorageSettings.tsx index 5ca3b229..9dbb4bc5 100644 --- a/components/settings/StorageSettings.tsx +++ b/components/settings/StorageSettings.tsx @@ -10,6 +10,7 @@ import { ListItem } from "../list/ListItem"; import { useTranslation } from "react-i18next"; import { storage } from "@/utils/mmkv"; import { RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY } from "@/utils/recently-added-notifications"; +import { useCallback } from "react"; export const StorageSettings = () => { const { deleteAllFiles, appSizeUsage } = useDownload(); @@ -43,6 +44,10 @@ export const StorageSettings = () => { return ((value / total) * 100).toFixed(2); }; + const clearRecentlyAddedNotifications = useCallback(() => { + storage.delete(RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY); + }, []); + return ( @@ -114,9 +119,7 @@ export const StorageSettings = () => { { - storage.set(RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY, "[]"); - }} + onPress={clearRecentlyAddedNotifications} title={"Reset recently added notifications"} />