show loading... initially instead of "No projects found" message at ui

This commit is contained in:
Pramod Mahajan 2025-05-04 18:53:34 +05:30
parent 294c13878d
commit a96fa8efc7

View File

@ -9,7 +9,7 @@ export const useProjects = () => {
const { profile } = useProfile();
const dispatch = useDispatch();
const [projects, setProjects] = useState([]);
const [loading, setLoading] = useState(false);
const [loading, setLoading] = useState(true);
const [error, setError] = useState("");
const projects_cache = getCachedData("projectslist");
@ -38,7 +38,8 @@ export const useProjects = () => {
} else {
if (!projects.length) {
const filtered = filterProjects(projects_cache);
setProjects(filtered);
setProjects( filtered );
setLoading(false);
}
}
};