Merge pull request #462 from redryerye/feat/preselect-phonenumber

Add default phone number selection when there is only one
This commit is contained in:
Matt Kiazyk 2023-12-20 08:28:57 -06:00 committed by GitHub
commit c85b3c2b6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,11 @@ struct SignInPhoneListView: View {
List(phoneNumbers, selection: $selectedPhoneNumberID) {
Text($0.numberWithDialCode)
}
.onAppear {
if phoneNumbers.count == 1 {
selectedPhoneNumberID = phoneNumbers.first?.id
}
}
} else {
AttributedText(
NSAttributedString(string: localizeString("NoTrustedPhones"))