diff --git a/client/src/components/circle/LearningSequence.vue b/client/src/components/circle/LearningSequence.vue index 91ccf59b..4f64590e 100644 --- a/client/src/components/circle/LearningSequence.vue +++ b/client/src/components/circle/LearningSequence.vue @@ -30,6 +30,26 @@ const allFinished = computed(() => { return false }) +const continueTranslationKey = computed(() => { + if (props.learningSequence && circleStore.circle) { + const childrenReversed = [...circleStore.circle.flatLearningContents].reverse() + const lastFinished = childrenReversed.find((learningContent) => { + return learningContent.completed + }) + + if (!lastFinished) { + // must be the first + return circleStore.circle.flatLearningContents[0].translation_key + } + + if (lastFinished && lastFinished.nextLearningContent) { + return lastFinished.nextLearningContent.translation_key + } + } + + return '' +}) + const learningSequenceBorderClass = computed(() => { let result = [] if (props.learningSequence && circleStore.circle) { @@ -77,6 +97,14 @@ const learningSequenceBorderClass = computed(() => { >{{ learningContent.contents[0].type }}: {{ learningContent.title }} + +