default project should not be set during the initial fetch. It will be set later based on specific conditions or user actions.
This commit is contained in:
parent
fd9a02aa4f
commit
e102abb117
@ -49,19 +49,19 @@ export const useProjects = () =>
|
|||||||
fetchData();
|
fetchData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect( () =>
|
// useEffect( () =>
|
||||||
{
|
// {
|
||||||
if (projects )
|
// if (projects )
|
||||||
{
|
// {
|
||||||
if ( profile?.projects && profile?.projects?.length > 0 )
|
// if ( profile?.projects && profile?.projects?.length > 0 )
|
||||||
{
|
// {
|
||||||
dispatch(setProjectId(profile?.projects[0]))
|
// dispatch(setProjectId(profile?.projects[0]))
|
||||||
} else
|
// } else
|
||||||
{
|
// {
|
||||||
dispatch(setProjectId(1))
|
// dispatch(setProjectId(1))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}, [profile]);
|
// }, [profile]);
|
||||||
|
|
||||||
return { projects, loading, error, refetch: fetchData };
|
return { projects, loading, error, refetch: fetchData };
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user