Merge pull request #2631 from woocommerce/PCP-3661-improve-context-detection-in-ajax

Improve context detection
This commit is contained in:
Emili Castells 2024-10-03 10:43:13 +02:00 committed by GitHub
commit 407eff51f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 81 additions and 25 deletions

View file

@ -31,8 +31,10 @@ import moduleStorage from './Helper/GooglePayStorage';
}
function bootstrapCheckout() {
if ( context && ! [ 'continuation', 'checkout' ].includes( context ) ) {
// Context must be missing/empty, or "continuation"/"checkout" to proceed.
if ( context
&& ! [ 'checkout' ].includes( context )
&& ! (context === 'mini-cart' && ppcpConfig.continuation) ) {
// Context must be missing/empty, or "checkout"/checkout continuation to proceed.
return;
}
if ( ! CheckoutBootstrap.isPageWithCheckoutForm() ) {