Skip to content

Commit 313a1b2

Browse files
committed
W-21012995, W-21103673: Addressing comments
1 parent fd64ba4 commit 313a1b2

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/template-retail-react-app/app/pages/checkout/partials/sf-payments-sheet.jsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,13 +531,20 @@ const SFPaymentsSheet = forwardRef((props, ref) => {
531531
const canSaveForFutureUsage = !!(customer?.isRegistered && customer?.customerId)
532532

533533
useEffect(() => {
534+
const isCustomerDataReady = !isCustomerDataLoading
535+
const hasNoCheckoutInstance = !checkoutComponent.current
536+
const hasSfp = !!sfp
537+
const hasMetadata = !!metadata
538+
const hasContainer = !!containerElementRef.current
539+
const hasPaymentConfig = !!paymentConfig
540+
534541
const readyToMountSFP =
535-
!isCustomerDataLoading &&
536-
!checkoutComponent.current &&
537-
!!sfp &&
538-
!!metadata &&
539-
!!containerElementRef.current &&
540-
!!paymentConfig
542+
isCustomerDataReady &&
543+
hasNoCheckoutInstance &&
544+
hasSfp &&
545+
hasMetadata &&
546+
hasContainer &&
547+
hasPaymentConfig
541548

542549
if (!readyToMountSFP) {
543550
return

0 commit comments

Comments
 (0)