sync update

This commit is contained in:
Milan Paunovic
2024-11-02 12:00:49 +01:00
parent a6b2c4b97f
commit 8a0370933d
4 changed files with 209 additions and 7 deletions

View File

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