mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-08 13:32:22 +00:00
fix: don't rerender function
This commit is contained in:
@@ -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 (
|
||||
<View>
|
||||
<View className="flex flex-col gap-y-1">
|
||||
@@ -114,9 +119,7 @@ export const StorageSettings = () => {
|
||||
<ListGroup>
|
||||
<ListItem
|
||||
textColor="red"
|
||||
onPress={() => {
|
||||
storage.set(RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY, "[]");
|
||||
}}
|
||||
onPress={clearRecentlyAddedNotifications}
|
||||
title={"Reset recently added notifications"}
|
||||
/>
|
||||
</ListGroup>
|
||||
|
||||
Reference in New Issue
Block a user