From 4fbadd6aa54441080517a4a25df363ce33494df1 Mon Sep 17 00:00:00 2001 From: Vardges Avetisyan Date: Thu, 19 Jan 2023 13:55:49 -0500 Subject: [PATCH] Respect the new skip account selection field --- .../Models/FinancialConnectionsPartnerAccount.swift | 1 + .../Native/AccountPicker/AccountPickerViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/Models/FinancialConnectionsPartnerAccount.swift b/StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/Models/FinancialConnectionsPartnerAccount.swift index 5c78206469e..2340eb9eec0 100644 --- a/StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/Models/FinancialConnectionsPartnerAccount.swift +++ b/StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/Models/FinancialConnectionsPartnerAccount.swift @@ -39,4 +39,5 @@ struct FinancialConnectionsDisabledPartnerAccount { struct FinancialConnectionsAuthSessionAccounts: Decodable { let data: [FinancialConnectionsPartnerAccount] let nextPane: FinancialConnectionsSessionManifest.NextPane + let skipAccountSelection: Bool? } diff --git a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift index bfc7e52e358..c743f9f20bb 100644 --- a/StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift +++ b/StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift @@ -130,7 +130,7 @@ final class AccountPickerViewController: UIViewController { switch result { case .success(let accountsPayload): let accounts = accountsPayload.data - + let shouldSkipAccountSelection = accountsPayload.skipAccountSelection ?? self.dataSource.authSession.skipAccountSelection ?? false if !accounts.isEmpty { self.dataSource .analyticsClient @@ -154,7 +154,7 @@ final class AccountPickerViewController: UIViewController { debugDescription: "API returned an empty list of accounts" ) ) - } else if self.dataSource.authSession.skipAccountSelection ?? false { + } else if shouldSkipAccountSelection { self.delegate?.accountPickerViewController( self, didSelectAccounts: accounts