Notification batch updates and notifications page update

This commit is contained in:
Milan Paunovic
2024-11-23 16:37:25 +01:00
parent cd178b8a9d
commit ee749e1077
5 changed files with 723 additions and 488 deletions

View File

@ -17,6 +17,7 @@ interface NotificationFirestore {
}
export interface Notification {
id: string;
creatorId: string;
familyId: string;
content: string;
@ -40,11 +41,14 @@ export const useGetNotifications = () => {
const data = doc.data() as NotificationFirestore;
return {
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
};
});
}
},
refetchOnWindowFocus: true,
staleTime: 60000,
});
};