Skip to content

Commit

Permalink
Refactor logic to hide container
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelzaleski committed Jul 9, 2024
1 parent 500e17b commit 806e790
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,11 @@ const ExpressCheckoutComponent = ( {

const availablePaymentMethods = event.availablePaymentMethods || {};

if ( paymentMethodContainer ) {
paymentMethodContainer.style.display = availablePaymentMethods[
expressPaymentMethod
]
? null
: 'none';
if (
paymentMethodContainer &&
! availablePaymentMethods[ expressPaymentMethod ]
) {
paymentMethodContainer.style.display = 'none';
}

// Any actions that WooPayments needs to perform.
Expand Down

0 comments on commit 806e790

Please sign in to comment.