Change block variable name.

This commit is contained in:
Pedro Silva 2023-12-14 09:39:02 +00:00
parent 2f0f0a7e0f
commit 1a2038bd78
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -31,7 +31,7 @@ const PayPalComponent = ({
const {responseTypes} = emitResponse;
const [paypalOrder, setPaypalOrder] = useState(null);
const [gotoContinuation, setGotoContinuation] = useState(false);
const [gotoContinuationOnError, setGotoContinuationOnError] = useState(false);
const methodId = fundingSource ? `${config.id}-${fundingSource}` : config.id;
@ -153,7 +153,7 @@ const PayPalComponent = ({
if (config.finalReviewEnabled) {
location.href = getCheckoutRedirectUrl();
} else {
setGotoContinuation(true);
setGotoContinuationOnError(true);
onSubmit();
}
} catch (err) {
@ -172,7 +172,7 @@ const PayPalComponent = ({
if (config.scriptData.continuation) {
return true;
}
if (gotoContinuation && wp.data.select('wc/store/validation').hasValidationErrors()) {
if (gotoContinuationOnError && wp.data.select('wc/store/validation').hasValidationErrors()) {
location.href = getCheckoutRedirectUrl();
return { type: responseTypes.ERROR };
}
@ -180,7 +180,7 @@ const PayPalComponent = ({
return true;
});
return unsubscribe;
}, [onCheckoutValidation, gotoContinuation] );
}, [onCheckoutValidation, gotoContinuationOnError] );
const handleClick = (data, actions) => {
if (isEditing) {