Prevent fetch calls with undefined selectedProject
This commit is contained in:
parent
d177c4a6fc
commit
bbb02009b2
@ -86,7 +86,7 @@ const TaskPlannng = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if((projects.length != 0)){
|
||||
if((projects.length != 0 && selectedProject)){
|
||||
fetchData();
|
||||
fetchActivities();
|
||||
}
|
||||
@ -103,11 +103,16 @@ const TaskPlannng = () => {
|
||||
|
||||
]}
|
||||
></Breadcrumb>
|
||||
|
||||
{project_listLoader && <p>Loading..</p>}
|
||||
{(!project_listLoader && projects.length === 0) && (<p>No Project Found.</p>)}
|
||||
{( !project_listLoader && projects.length > 0 ) && (
|
||||
<InfraPlanning
|
||||
data={projectDetails}
|
||||
activityMaster={activities}
|
||||
onDataChange={handleDataChange}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user