From 51a2f9e3ef501a85fde661e08b060d0ca093494a Mon Sep 17 00:00:00 2001 From: Clark Sell Date: Fri, 13 Oct 2023 09:10:32 -0500 Subject: [PATCH] fix: recaptcha undefined --- src/routes/+layout.svelte | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ac61c4d..15c2e4c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -50,11 +50,13 @@ } onMount(() => { - /* eslint-disable no-undef */ - grecaptcha.enterprise.ready(async () => { + if (window.grecaptcha) { /* eslint-disable no-undef */ - await grecaptcha.enterprise.execute(recaptcha.siteKey, { action: 'site_load' }); - }); + grecaptcha.enterprise.ready(async () => { + /* eslint-disable no-undef */ + await grecaptcha.enterprise.execute(recaptcha.siteKey, { action: 'site_load' }); + }); + } if ($showReleaseNotes) { messages.update((m) => [