Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where multiple accounts are selected for single select #4187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ final class AccountPickerViewController: UIViewController {
// AND `authSession.skipAccountSelection` is true
let skipAccountSelection = (accountsPayload.skipAccountSelection ?? self.dataSource.authSession.skipAccountSelection ?? false)
if skipAccountSelection {
self.dataSource.updateSelectedAccounts(accounts)
if self.dataSource.manifest.singleAccount {
if let firstEnabledAccount = accounts.first(where: \.allowSelectionNonOptional) {
self.dataSource.updateSelectedAccounts([firstEnabledAccount])
}
Comment on lines +188 to +191
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosmuvi-stripe Any thoughts on what we should do in the else block of this condition? This would be where no accounts have been selected.

} else {
self.dataSource.updateSelectedAccounts(accounts)
}
self.didSelectLinkAccounts(isSkipAccountSelection: true)
} else if
self.dataSource.manifest.singleAccount,
Expand Down
Loading