Skip to content

Commit

Permalink
fix: saved method checkbox condition updated (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
rising-dragon401 committed May 22, 2024
1 parent 8bc3c2f commit 1aa6030
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Components/SavedMethods.res
Original file line number Diff line number Diff line change
Expand Up @@ -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,
))

<div className="flex flex-col overflow-auto h-auto no-scrollbar animate-slowShow">
{if savedCardlength === 0 && (loadSavedCards === PaymentType.LoadingSavedCards || !showFields) {
Expand Down

0 comments on commit 1aa6030

Please sign in to comment.