mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
♻️ Minor cleanup
This commit is contained in:
parent
eba92e6b81
commit
734951adcb
2 changed files with 22 additions and 23 deletions
|
@ -19,8 +19,6 @@ export class CheckoutBootstrap {
|
|||
|
||||
constructor( storage ) {
|
||||
this.#storage = storage;
|
||||
|
||||
this.onFormSubmit = this.onFormSubmit.bind( this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,7 +42,7 @@ export class CheckoutBootstrap {
|
|||
* @return {boolean} True, if a checkout form is present.
|
||||
*/
|
||||
get isPageWithCheckoutForm() {
|
||||
return this.checkoutForm instanceof HTMLElement;
|
||||
return null !== this.checkoutForm;
|
||||
}
|
||||
|
||||
init() {
|
||||
|
@ -65,13 +63,14 @@ export class CheckoutBootstrap {
|
|||
|
||||
const billingData = this.#storage.getPayer();
|
||||
|
||||
if ( billingData ) {
|
||||
setPayerData( billingData );
|
||||
|
||||
this.checkoutForm.addEventListener( 'submit', () =>
|
||||
this.#onFormSubmit()
|
||||
);
|
||||
if ( ! billingData ) {
|
||||
return;
|
||||
}
|
||||
|
||||
setPayerData( billingData, true );
|
||||
this.checkoutForm.addEventListener( 'submit', () =>
|
||||
this.#onFormSubmit()
|
||||
);
|
||||
}
|
||||
|
||||
#onFormSubmit() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue