Skip to content

Commit

Permalink
fix(turnstile): store turnstile key on @submit instead of @click
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMi committed May 5, 2023
1 parent 9ee78b1 commit 81bd5c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nuxt/components/form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
formClass,
]"
novalidate
@submit="(e) => emit('submit', e)"
@submit="(e) => onSubmit(e)"
>
<Card class="flex flex-col" is-high>
<div class="flex flex-col min-h-0 overflow-y-auto gap-6">
Expand All @@ -27,7 +27,7 @@
'animate-shake': form.$error,
}"
type="submit"
@click="storeTurnstileKey()"
@click="emit('click')"
>
{{ submitName || t('submit') }}
<template #prefix>
Expand Down Expand Up @@ -97,6 +97,11 @@ const store = useMaevsiStore()
const { t } = useI18n()
// methods
const onSubmit = (e: Event) => {
storeTurnstileKey()
emit('submit', e)
}
const storeTurnstileKey = () => {
store.turnstileKey = form.turnstileKey
}
Expand Down

0 comments on commit 81bd5c8

Please sign in to comment.