From 8642913f5ba4be1c441499f15da2aab64870b209 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 22 May 2024 17:31:36 +0530 Subject: [PATCH] fix: saved method checkbox condition updated (#395) --- src/Components/SavedMethods.res | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Components/SavedMethods.res b/src/Components/SavedMethods.res index ca1751825..7d8544605 100644 --- a/src/Components/SavedMethods.res +++ b/src/Components/SavedMethods.res @@ -176,8 +176,16 @@ let make = ( let conditionsForShowingSaveCardCheckbox = React.useMemo(() => { !isGuestCustomer && paymentMethodListValue.payment_type === NEW_MANDATE && - displaySavedPaymentMethodsCheckbox - }, (isGuestCustomer, paymentMethodListValue.payment_type, displaySavedPaymentMethodsCheckbox)) + displaySavedPaymentMethodsCheckbox && + savedMethods->Array.some(ele => { + ele.paymentMethod === "card" && ele.requiresCvv + }) + }, ( + isGuestCustomer, + paymentMethodListValue.payment_type, + displaySavedPaymentMethodsCheckbox, + savedMethods, + ))
{if savedCardlength === 0 && (loadSavedCards === PaymentType.LoadingSavedCards || !showFields) {