diff --git a/src/pages/projects/ui/ProjectPage.tsx b/src/pages/projects/ui/ProjectPage.tsx index 66bd0712..5f7922c1 100644 --- a/src/pages/projects/ui/ProjectPage.tsx +++ b/src/pages/projects/ui/ProjectPage.tsx @@ -22,7 +22,7 @@ import { Rating } from '~/features/user'; import { Card } from '~/entities/project'; -import { useApi } from '~/shared/hooks'; +import { useApi, useIsAuth } from '~/shared/hooks'; import { GoBack } from '~/shared/ui/GoBack'; import { STag } from '~/shared/ui/STag'; @@ -42,6 +42,7 @@ const dummyData = [ export const ProjectPage = () => { const { id: projectId } = useParams(); const { projectsApi, userApi } = useApi(); + const isAuth = useIsAuth(); const [ownerID, setOwnerID] = useState(''); @@ -60,9 +61,9 @@ export const ProjectPage = () => { }); const { data: myData, isLoading: meIsLoading } = useQuery({ - queryKey: ['myID', ownerID], + queryKey: ['myID', ownerID, isAuth], queryFn: () => userApi.getMe(), - enabled: !!ownerID, + enabled: !!ownerID && !!isAuth, }); return (