mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
🐛 FIx the button preview in admin settings
This commit is contained in:
parent
367f2b86c4
commit
40688b706f
1 changed files with 16 additions and 7 deletions
|
@ -5,6 +5,11 @@ import PreviewButton from '../../../../ppcp-button/resources/js/modules/Preview/
|
||||||
* A single Apple Pay preview button instance.
|
* A single Apple Pay preview button instance.
|
||||||
*/
|
*/
|
||||||
export default class ApplePayPreviewButton extends PreviewButton {
|
export default class ApplePayPreviewButton extends PreviewButton {
|
||||||
|
/**
|
||||||
|
* @type {?PaymentButton}
|
||||||
|
*/
|
||||||
|
#button = null;
|
||||||
|
|
||||||
constructor( args ) {
|
constructor( args ) {
|
||||||
super( args );
|
super( args );
|
||||||
|
|
||||||
|
@ -19,14 +24,18 @@ export default class ApplePayPreviewButton extends PreviewButton {
|
||||||
}
|
}
|
||||||
|
|
||||||
createButton( buttonConfig ) {
|
createButton( buttonConfig ) {
|
||||||
const button = new ApplepayButton(
|
if ( ! this.#button ) {
|
||||||
'preview',
|
this.#button = new ApplepayButton(
|
||||||
null,
|
'preview',
|
||||||
buttonConfig,
|
null,
|
||||||
this.ppcpConfig
|
buttonConfig,
|
||||||
);
|
this.ppcpConfig
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
button.init( this.apiConfig );
|
this.#button.configure( this.apiConfig, null );
|
||||||
|
this.#button.applyButtonStyles( buttonConfig, this.ppcpConfig );
|
||||||
|
this.#button.reinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue