Add comment because of load workaround in cockpit
This commit is contained in:
parent
b36754991e
commit
0df74774d0
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {
|
||||||
useCourseSessionDetailQuery,
|
|
||||||
useCourseDataWithCompletion,
|
useCourseDataWithCompletion,
|
||||||
|
useCourseSessionDetailQuery,
|
||||||
} from "@/composables";
|
} from "@/composables";
|
||||||
import { useCockpitStore } from "@/stores/cockpit";
|
import { useCockpitStore } from "@/stores/cockpit";
|
||||||
import * as log from "loglevel";
|
import * as log from "loglevel";
|
||||||
|
|
@ -27,11 +27,14 @@ onMounted(async () => {
|
||||||
props.courseSlug,
|
props.courseSlug,
|
||||||
courseSessionDetailResult.findCurrentUser()
|
courseSessionDetailResult.findCurrentUser()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// workaround so that the completion data is loaded before display
|
||||||
const userDataPromises = courseSessionDetailResult.filterMembers().map((m) => {
|
const userDataPromises = courseSessionDetailResult.filterMembers().map((m) => {
|
||||||
const completionData = useCourseDataWithCompletion(props.courseSlug, m.id);
|
const completionData = useCourseDataWithCompletion(props.courseSlug, m.id);
|
||||||
return completionData.resultPromise;
|
return completionData.resultPromise;
|
||||||
});
|
});
|
||||||
await Promise.all(userDataPromises);
|
await Promise.all(userDataPromises);
|
||||||
|
|
||||||
loaded.value = true;
|
loaded.value = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(error);
|
log.error(error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue