fix: wait for completion before nav
This commit is contained in:
parent
1310bf1d3d
commit
f7aa5a35ca
|
|
@ -64,8 +64,8 @@ function handleFinishedLearningContent() {
|
||||||
props.learningContent,
|
props.learningContent,
|
||||||
props.circle,
|
props.circle,
|
||||||
previousRoute,
|
previousRoute,
|
||||||
(lc: LearningContentWithCompletion) => {
|
async (lc: LearningContentWithCompletion) => {
|
||||||
courseCompletionData.markCompletion(lc, "SUCCESS");
|
await courseCompletionData.markCompletion(lc, "SUCCESS");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,16 +73,18 @@ export const useCircleStore = defineStore({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
continueFromLearningContent(
|
async continueFromLearningContent(
|
||||||
currentLearningContent: LearningContentWithCompletion,
|
currentLearningContent: LearningContentWithCompletion,
|
||||||
circle: CircleType,
|
circle: CircleType,
|
||||||
returnRoute?: RouteLocationNormalized,
|
returnRoute?: RouteLocationNormalized,
|
||||||
markCompletionFn?: (learningContent: LearningContentWithCompletion) => void
|
markCompletionFn?: (
|
||||||
|
learningContent: LearningContentWithCompletion
|
||||||
|
) => Promise<void>
|
||||||
) {
|
) {
|
||||||
if (currentLearningContent) {
|
if (currentLearningContent) {
|
||||||
if (currentLearningContent.can_user_self_toggle_course_completion) {
|
if (currentLearningContent.can_user_self_toggle_course_completion) {
|
||||||
if (markCompletionFn) {
|
if (markCompletionFn) {
|
||||||
markCompletionFn(currentLearningContent);
|
await markCompletionFn(currentLearningContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.closeLearningContent(currentLearningContent, circle, returnRoute);
|
this.closeLearningContent(currentLearningContent, circle, returnRoute);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue