mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix js error check if element exist before using it
This commit is contained in:
parent
d4e0167d88
commit
d219157bcd
1 changed files with 11 additions and 4 deletions
|
@ -407,10 +407,17 @@ class ApplePayButton {
|
|||
.querySelectorAll( 'style#ppcp-hide-apple-pay' )
|
||||
.forEach( ( el ) => el.remove() );
|
||||
|
||||
const paymentMethodAppleLi = document.querySelector('.wc_payment_method.payment_method_ppcp-applepay' );
|
||||
if (paymentMethodAppleLi.style.display === 'none' || paymentMethodAppleLi.style.display === '') {
|
||||
paymentMethodAppleLi.style.display = 'block';
|
||||
}
|
||||
const paymentMethodAppleLi = document.querySelector(
|
||||
'.wc_payment_method.payment_method_ppcp-applepay'
|
||||
);
|
||||
|
||||
if (
|
||||
paymentMethodAppleLi &&
|
||||
( paymentMethodAppleLi.style.display === 'none' ||
|
||||
paymentMethodAppleLi.style.display === '' )
|
||||
) {
|
||||
paymentMethodAppleLi.style.display = 'block';
|
||||
}
|
||||
|
||||
this.allElements.forEach( ( element ) => {
|
||||
element.style.display = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue