Add comment because of load workaround in cockpit

This commit is contained in:
Daniel Egger 2023-10-15 22:05:16 +02:00
parent b36754991e
commit 0df74774d0
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import {
useCourseSessionDetailQuery,
useCourseDataWithCompletion,
useCourseSessionDetailQuery,
} from "@/composables";
import { useCockpitStore } from "@/stores/cockpit";
import * as log from "loglevel";
@ -27,11 +27,14 @@ onMounted(async () => {
props.courseSlug,
courseSessionDetailResult.findCurrentUser()
);
// workaround so that the completion data is loaded before display
const userDataPromises = courseSessionDetailResult.filterMembers().map((m) => {
const completionData = useCourseDataWithCompletion(props.courseSlug, m.id);
return completionData.resultPromise;
});
await Promise.all(userDataPromises);
loaded.value = true;
} catch (error) {
log.error(error);