From f99267c6115601fce6eadd6ee54893fde0d6fd84 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 24 Aug 2023 09:51:07 +0200 Subject: [PATCH] fix(front): fix confirm anonymous participation Signed-off-by: Thomas Citharel --- .../Participation/ConfirmParticipation.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/js/src/components/Participation/ConfirmParticipation.vue b/js/src/components/Participation/ConfirmParticipation.vue index e433a581c..223da0cc1 100644 --- a/js/src/components/Participation/ConfirmParticipation.vue +++ b/js/src/components/Participation/ConfirmParticipation.vue @@ -67,7 +67,7 @@ import { EventJoinOptions } from "@/types/enums"; import { IParticipant } from "../../types/participant.model"; import RouteName from "../../router/name"; import { CONFIRM_PARTICIPATION } from "../../graphql/event"; -import { computed, ref } from "vue"; +import { computed, ref, watchEffect } from "vue"; import { useMutation } from "@vue/apollo-composable"; import { useI18n } from "vue-i18n"; import { useHead } from "@vueuse/head"; @@ -90,9 +90,15 @@ const { onDone, onError, mutate } = useMutation<{ confirmParticipation: IParticipant; }>(CONFIRM_PARTICIPATION); -mutate(() => ({ - token: props.token, -})); +const participationToken = computed(() => props.token); + +watchEffect(() => { + if (participationToken.value) { + mutate({ + token: participationToken.value, + }); + } +}); onDone(async ({ data }) => { participation.value = data?.confirmParticipation;