Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/lib/ui/app/Footer/DigestForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
return mutateEmailLoginNewsletter()({ email, token }).pipe(
catchError((error) => {
console.error(error)
turnstileRef.reset()
return of(null)
}),
tap(() => (loading = false)),
tap(() => {
loading = false
turnstileRef.reset()
}),
tap((result) => {
if (result) {
notification.success('Verification email was sent to the provided email!')
Expand Down
9 changes: 5 additions & 4 deletions src/lib/ui/app/LoginForm/Turnstile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
}

export function reset() {
if (widgetId) turnstile?.reset(widgetId)
if (!widgetId) return

turnstile?.reset(widgetId)
controller = controlledPromisePolyfill<string>()
}

onMount(() => {
Expand All @@ -37,9 +40,7 @@
},
'expired-callback': () => {
controller.reject('expired-callback')
turnstile.reset()

controller = controlledPromisePolyfill<string>()
reset()
},
})
}
Expand Down