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