Skip to content

Commit

Permalink
Merge branch 'main' into robots2
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 authored Jul 25, 2024
2 parents 32acbcf + 040cd07 commit 17ecd05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/dropins.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ export default async function initializeDropins() {
// Set Fetch Endpoint (Global)
setEndpoint(await getConfigValue('commerce-core-endpoint'));

// Mount all registered dropins
// Mount all registered drop-ins
if (document.readyState === 'complete') {
initializers.mount();
} else {
// Handle on prerendering document activated
document.addEventListener('prerenderingchange', initializers.mount);
// Handle on page load
window.addEventListener('load', initializers.mount);
}

Expand Down

0 comments on commit 17ecd05

Please sign in to comment.