Set attendance data only if empty

This commit is contained in:
rotimi-best
2021-09-06 11:10:54 +03:00
parent 09f986f43e
commit cc1cd9d48b
+6 -1
View File
@@ -52,7 +52,12 @@
}
onMount(async () => {
if ($course.id) return;
if ($course.id) {
if (!Object.keys($attendance).length) {
setAttendance($course);
}
return;
}
const { data } = await fetchCourse(courseId);
setCourseData(data);