Skip to content

Commit

Permalink
simplified logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceqin-stripe committed Nov 19, 2024
1 parent 8ceaad4 commit 321bf91
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ class VerticalSavedPaymentMethodsViewController: UIViewController {
var canEdit: Bool {
// We can edit if there are removable or editable payment methods and we are not in remove only mode
// Or, under the new navigation flow, if any of the payment methods are cards
return ((canRemovePaymentMethods || (hasCoBrandedCards && isCBCEligible)) && !isRemoveOnlyMode) || (configuration.alternateUpdatePaymentMethodNavigation && !paymentMethods.filter {
let paymentMethodType = $0.type
return UpdatePaymentMethodViewModel.supportedPaymentMethods.contains { type in paymentMethodType == type }}.isEmpty)
return ((canRemovePaymentMethods || (hasCoBrandedCards && isCBCEligible)) && !isRemoveOnlyMode) || (configuration.alternateUpdatePaymentMethodNavigation && paymentMethods.contains { UpdatePaymentMethodViewModel.supportedPaymentMethods.contains($0.type) })
}

private var selectedPaymentMethod: STPPaymentMethod? {
Expand Down

0 comments on commit 321bf91

Please sign in to comment.