From 4878bd18029499614aa803dbb2efc5ec8f90edf9 Mon Sep 17 00:00:00 2001 From: Santiago Garcia Date: Wed, 1 May 2024 14:40:54 -0700 Subject: [PATCH] fix useEffect warnings --- client/src/pages/Profile.tsx | 2 +- client/src/pages/Project.tsx | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/client/src/pages/Profile.tsx b/client/src/pages/Profile.tsx index de8ee19..40be9dc 100644 --- a/client/src/pages/Profile.tsx +++ b/client/src/pages/Profile.tsx @@ -117,7 +117,7 @@ export function EditProfile() { useEffect(() => { if (!user) return; setImage(user.imageUrl); - }, [isLoaded]); + }, [isLoaded, user]); if (!isSignedIn) return
must be logged in
; diff --git a/client/src/pages/Project.tsx b/client/src/pages/Project.tsx index 12c92a3..aa59c1b 100644 --- a/client/src/pages/Project.tsx +++ b/client/src/pages/Project.tsx @@ -75,14 +75,6 @@ export default function Project() { } } - const requestData = trpc.memberships.getAllPendingRequests.useQuery( - projectId ?? '', - ); - - if (requestData.data != undefined) { - console.log(requestData.data); - } - const leaveProjectMutation = trpc.memberships.leaveProject.useMutation({ onSuccess() { console.log('Left Project'); @@ -523,12 +515,10 @@ export function ProjectPostsLayout() { useEffect(() => { if (postId === undefined && data) { - console.log('here'); - if (data.length === 0) return; navigate(`/${projectId}/posts/${data[0].id}`); } - }, []); + }, [data, navigate, postId, projectId]); if (isLoading) return
loading posts
;