Deletion fix

This commit is contained in:
Milan Paunovic
2024-12-24 23:19:23 +01:00
parent 609d01b81c
commit 7d3e39b77d
23 changed files with 312 additions and 638 deletions

View File

@ -29,6 +29,8 @@ export interface Notification {
export const useGetNotifications = () => {
const { user, profileData } = useAuthContext();
console.log(profileData?.familyId)
return useQuery<Notification[], Error>({
queryKey: ["notifications", user?.uid],
queryFn: async () => {
@ -44,11 +46,13 @@ export const useGetNotifications = () => {
id: doc.id,
...data,
timestamp: new Date(data.timestamp.seconds * 1000 + data.timestamp.nanoseconds / 1e6),
date: data.date ? new Date(data.date.seconds * 1000 + data.date.nanoseconds / 1e6) : undefined
date: data.date ? new Date(data.date.seconds * 1000 + data.date.nanoseconds / 1e6) : undefined,
};
});
},
refetchOnWindowFocus: true,
staleTime: 60000,
staleTime: Infinity,
gcTime: Infinity,
placeholderData: (previousData) => previousData,
});
};