From ec7d5717c11b0666c2bcf8a183eba44dfd71032f Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Tue, 2 Jul 2024 15:23:42 +0530 Subject: [PATCH] fix: wallets on top for saved cards flow --- src/PaymentElement.res | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PaymentElement.res b/src/PaymentElement.res index 8a0ca1eb5..2e0d0297d 100644 --- a/src/PaymentElement.res +++ b/src/PaymentElement.res @@ -89,11 +89,14 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod let paymentOrder = paymentMethodOrder->getOptionalArr->removeDuplicate - let sortSavedMethodsBasedOnPriority = + let sortSavedMethodsBasedOnPriority = switch paymentOrder { + | [] => finalSavedPaymentMethods + | paymentOrder => finalSavedPaymentMethods->PaymentUtils.sortCustomerMethodsBasedOnPriority( paymentOrder, ~displayDefaultSavedPaymentIcon, ) + } setSavedMethods(_ => sortSavedMethodsBasedOnPriority) setLoadSavedCards(_ =>