Skip to content

Commit

Permalink
fix useEffect warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoG14 committed May 1, 2024
1 parent 9be5182 commit 4878bd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function EditProfile() {
useEffect(() => {
if (!user) return;
setImage(user.imageUrl);
}, [isLoaded]);
}, [isLoaded, user]);

if (!isSignedIn) return <div>must be logged in</div>;

Expand Down
12 changes: 1 addition & 11 deletions client/src/pages/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 <div>loading posts</div>;

Expand Down

0 comments on commit 4878bd1

Please sign in to comment.