Skip to content
Snippets Groups Projects
Commit 05a4f208 authored by Trygve Jørgensen's avatar Trygve Jørgensen
Browse files

enhancement(sparesti): user gets a text notification if they have completed a challenge

parent d745cf50
No related branches found
No related tags found
2 merge requests!66Final merge,!62WCAG fixes
......@@ -117,6 +117,12 @@
alt="Finish Line"
/>
</div>
<div v-if="showCompletedText" class="flex flex-row justify-center items-center mt-4 gap-3">
<span>Gratulerer! Du har fullført en utfordring!</span>
<button class="primary" @click="showCompletedText = false">Skjul</button>
</div>
<!-- Goal -->
<div v-if="goalLocal" class="flex flex-row justify-around m-t-2 pt-6 w-full mx-auto">
<div class="grid grid-rows-2 grid-flow-col gap 4">
......@@ -197,6 +203,8 @@ let goalLocal: Goal | null | undefined = reactive({
const isMounted = ref<boolean>(false)
const componentKey = ref<number>(0)
const showCompletedText = ref(false)
//Initialisation:
onMounted(async () => {
......@@ -349,6 +357,7 @@ const animateChallenge = (challenge: Challenge) => {
challenge.completion! >= 100 &&
!animatedChallenges.value.includes(challenge.id as number)
) {
showCompletedText.value = true
if (challenge.id != null) {
animatedChallenges.value.push(challenge.id)
} // Ensure no duplication
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment