mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Add ButtonModuleWatcher
Adjustments for APM support
This commit is contained in:
parent
e7e5ebde4e
commit
93afeeba68
6 changed files with 59 additions and 14 deletions
|
@ -2,6 +2,7 @@ import {useEffect, useState} from '@wordpress/element';
|
|||
import {registerExpressPaymentMethod, registerPaymentMethod} from '@woocommerce/blocks-registry';
|
||||
import {paypalAddressToWc, paypalOrderToWcAddresses} from "./Helper/Address";
|
||||
import {loadPaypalScript} from '../../../ppcp-button/resources/js/modules/Helper/ScriptLoading'
|
||||
import buttonModuleWatcher from "../../../ppcp-button/resources/js/modules/ButtonModuleWatcher";
|
||||
|
||||
const config = wc.wcSettings.getSetting('ppcp-gateway_data');
|
||||
|
||||
|
@ -28,6 +29,7 @@ const PayPalComponent = ({
|
|||
if (!loaded) {
|
||||
loadPaypalScript(config.scriptData, () => {
|
||||
setLoaded(true);
|
||||
buttonModuleWatcher.registerContextBootstrap(config.scriptData.context, this);
|
||||
});
|
||||
}
|
||||
}, [loaded]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue