Skip to content

Commit

Permalink
moved recaptcha post lcp
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhipster committed Nov 27, 2024
1 parent d6380d5 commit 3c2e651
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/initializers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {
} from '@dropins/tools/fetch-graphql.js';
import * as authApi from '@dropins/storefront-auth/api.js';

// Recaptcha
// import * as recaptcha from '@dropins/tools/recaptcha.js';

// Libs
import { getConfigValue, getCookie } from '../configs.js';

Expand Down Expand Up @@ -52,8 +49,13 @@ export default async function initializeDropins() {
events.enableLogger(true);
// Set Fetch Endpoint (Global)
setEndpoint(await getConfigValue('commerce-core-endpoint'));
// Recaptcha
// recaptcha.setConfig();

events.on('eds/lcp', async () => {
// Recaptcha
await import('@dropins/tools/recaptcha.js').then(({ setConfig }) => {
setConfig();
});
});

// Initialize Global Drop-ins
await import('./auth.js');
Expand Down

0 comments on commit 3c2e651

Please sign in to comment.