chore: improve ux of fetching course

This commit is contained in:
Rotimi Best
2023-12-13 09:29:06 +03:00
parent 09d8c72019
commit 74f3db41bc
4 changed files with 16 additions and 4 deletions
@@ -30,7 +30,10 @@
async function getCourses(userId: string | null, orgId: string) {
if (cantFetch && typeof cantFetch === 'boolean' && !allCourses.length && orgId && !hasFetched) {
$courseMetaDeta.isLoading = true;
// only show is loading when fetching for the first time
if (!$courses.length) {
$courseMetaDeta.isLoading = true;
}
const coursesResult = await fetchCourses(userId, orgId);
console.log(`coursesResult`, coursesResult);