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

[ABW-3607] Preselect account on Login #1220

Merged
merged 1 commit into from
Jul 17, 2024
Merged
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
11 changes: 10 additions & 1 deletion RadixWallet/Features/ChooseAccounts/ChooseAccounts+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ extension ChooseAccounts {
)
}
self.selectionRequirement = selectionRequirement
self.selectedAccounts = state.selectedAccounts
self.canCreateNewAccount = state.canCreateNewAccount

// If the dApp is asking for exactly(1) account and user has only one account, pre-select it
if let account = availableAccounts.first,
availableAccounts.count == 1,
selectionRequirement == .exactly(1)
{
self.selectedAccounts = [account]
} else {
self.selectedAccounts = state.selectedAccounts
}
}
}

Expand Down
Loading