Skip to content

Commit

Permalink
fix: ProjectSearch stuck on infinite loading
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Oct 16, 2024
1 parent c6248b6 commit 78b2871
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions client/src/views/ProjectsView/ProjectsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,26 @@ const ProjectsView = (): ReactElement => {
data: searchedProjects,
refetch: refetchSearchedProjects,
status: statusSearchedProjects,
isFetching: isFetchingSearchedProjects,
} = useSearchedProjects(projectsSearchParameters);
const {
data: searchedProjectsDetails,
refetch: refetchSearchedProjectsDetails,
isFetching: isFetchingSearchedProjectsDetails,
} = useSearchedProjectsDetails(searchedProjects);

useEffect(() => {
if (
isProjectsSearchInProgress &&
searchedProjects &&
searchedProjects.length === 0 &&
!isFetchingSearchedProjects
) {
setIsProjectsSearchInProgress(false);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchedProjects, isFetchingSearchedProjects]);

useEffect(() => {
if (isFetchingSearchedProjectsDetails) {
return;
Expand Down

0 comments on commit 78b2871

Please sign in to comment.