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(_ =>