sync update

This commit is contained in:
Milan Paunovic
2024-11-02 22:27:17 +01:00
parent 8a0370933d
commit f1b0bcd32d
6 changed files with 221 additions and 118 deletions

View File

@ -164,19 +164,19 @@ 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) => {
// const eventId = notification?.request?.content?.data?.eventId;
//
// // if (eventId) {
// queryClient.invalidateQueries(['events']);
// // }
// };
//
// const sub = Notifications.addNotificationReceivedListener(handleNotification);
//
// return () => sub.remove();
// }, []);
if (!ready) {
return null;