Commit 9f141d4c authored by Zhou Fang's avatar Zhou Fang
Browse files

Fixed loading spinner logic issue

parent 45b3bbcb
......@@ -28,12 +28,13 @@ export default function DashboardProjects({ setSelectedItemArray, setOpen }: Das
} = useContext(PortalContext);
useEffect(() => {
if (!orgId) {
return;
}
if (yourProjectsData !== null || interestedProjectsData !== null || allYourProjectsData !== null) {
if (yourProjectsData !== null && allYourProjectsData !== null) {
setIsFetchingYourProjects(false);
}
if (interestedProjectsData !== null) {
setIsFetchingInterestedProjects(false);
}
if (!orgId || yourProjectsData !== null || interestedProjectsData !== null || allYourProjectsData !== null) {
return;
}
......
......@@ -29,9 +29,13 @@ export default function DashboardWGs({ setSelectedItemArray, setOpen }: Dashboar
} = useContext(PortalContext);
useEffect(() => {
if (orgInfo === null || orgId === 0 || allYourWGData !== null || interestedWGData !== null || yourWGData !== null) {
if (allYourWGData !== null && yourWGData !== null) {
setIsFetchingYourWGs(false);
}
if (interestedWGData !== null) {
setIsFetchingInterestedWGs(false);
}
if (orgInfo === null || !orgId || allYourWGData !== null || interestedWGData !== null || yourWGData !== null) {
return;
}
// Loop through the array using the id to get related wg names
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment