Set attendance data only if empty
This commit is contained in:
@@ -52,7 +52,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
if ($course.id) return;
|
if ($course.id) {
|
||||||
|
if (!Object.keys($attendance).length) {
|
||||||
|
setAttendance($course);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const { data } = await fetchCourse(courseId);
|
const { data } = await fetchCourse(courseId);
|
||||||
setCourseData(data);
|
setCourseData(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user