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

@ -164,19 +164,15 @@ export const AuthContextProvider: FC<{ children: ReactNode }> = ({children}) =>
}
}, [user, ready, redirectOverride]);
// useEffect(() => {
// const handleNotification = async (notification: Notifications.Notification) => {
// const eventId = notification?.request?.content?.data?.eventId;
//
// // if (eventId) {
// queryClient.invalidateQueries(['events']);
// // }
// };
//
// const sub = Notifications.addNotificationReceivedListener(handleNotification);
//
// return () => sub.remove();
// }, []);
useEffect(() => {
const handleNotification = async (notification: Notifications.Notification) => {
queryClient.invalidateQueries(["notifications"]);
};
const sub = Notifications.addNotificationReceivedListener(handleNotification);
return () => sub.remove();
}, []);
if (!ready) {
return null;