Skip to content

Commit ba2b724

Browse files
committed
Prevent button re-rendering during resume flow in single product context
1 parent 0bd86d6 commit ba2b724

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

modules/ppcp-blocks/resources/js/Components/paypal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ export const PayPalComponent = ( {
316316
}
317317
const unsubscribe = onCheckoutFail( ( { processingResponse } ) => {
318318
console.error( processingResponse );
319-
setIsFullPageSpinnerActive( false );
320319
if ( onClose ) {
321320
onClose();
322321
}

modules/ppcp-button/resources/js/modules/ContextBootstrap/SingleProductBootstrap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import SimulateCart from '../Helper/SimulateCart';
88
import { strRemoveWord, strAddWord, throttle } from '../Helper/Utils';
99
import merge from 'deepmerge';
1010
import { debounce } from '../../../../../ppcp-blocks/resources/js/Helper/debounce';
11+
import ResumeFlowHelper from '../Helper/ResumeFlowHelper';
1112

1213
class SingleProductBootstrap {
1314
constructor( gateway, renderer, errorHandler ) {
@@ -53,7 +54,10 @@ class SingleProductBootstrap {
5354
return;
5455
}
5556

56-
this.render();
57+
// Avoid re-rendering during the resume flow to prevent duplicate onApprove callbacks.
58+
if ( ! ResumeFlowHelper.isResumeFlow() ) {
59+
this.render();
60+
}
5761

5862
this.renderer.enableSmartButtons( this.gateway.button.wrapper );
5963
show( this.gateway.button.wrapper );

0 commit comments

Comments
 (0)