resolved merge conflict
This commit is contained in:
parent
4b3f8cc50f
commit
098aa9749f
@ -12,6 +12,11 @@ export const useProjects = () => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const fetchData = async () =>
|
||||
{
|
||||
console.log("calldd")
|
||||
const projectIds = profile?.projects || [];
|
||||
|
||||
const projects_cache = getCachedData("projectslist");
|
||||
const fetchData = async () => {
|
||||
const projectIds = profile?.projects || [];
|
||||
@ -21,6 +26,7 @@ export const useProjects = () => {
|
||||
.filter((proj) => projectIds.includes(String(proj.id)))
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
};
|
||||
const projects_cache = getCachedData("projectList")
|
||||
|
||||
if (!projects_cache) {
|
||||
setLoading(true);
|
||||
@ -44,12 +50,20 @@ export const useProjects = () => {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect( () =>
|
||||
{
|
||||
|
||||
if ( profile )
|
||||
{
|
||||
useEffect(() => {
|
||||
if (profile) {
|
||||
fetchData();
|
||||
}
|
||||
}, [profile]);
|
||||
|
||||
|
||||
}, [profile]);
|
||||
|
||||
return { projects, loading, error, refetch: fetchData };
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user