From 806e790cb90d09244ed9dfaf2e5a56eced8d3192 Mon Sep 17 00:00:00 2001 From: Rafael Zaleski Date: Tue, 9 Jul 2024 16:48:46 -0300 Subject: [PATCH] Refactor logic to hide container --- .../blocks/components/express-checkout-component.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/express-checkout/blocks/components/express-checkout-component.js b/client/express-checkout/blocks/components/express-checkout-component.js index fb79d193b87..35404be68a0 100644 --- a/client/express-checkout/blocks/components/express-checkout-component.js +++ b/client/express-checkout/blocks/components/express-checkout-component.js @@ -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.