show loading... initially instead of "No projects found" message at ui
This commit is contained in:
parent
294c13878d
commit
a96fa8efc7
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user