Fix default country code.

This commit is contained in:
Michelle Tang
2025-02-10 08:48:26 -05:00
parent d2b7f273f9
commit 85a5e058fb
2 changed files with 6 additions and 0 deletions

View File

@@ -67,9 +67,12 @@ class EnterPhoneNumberViewModel : ViewModel() {
}
val countryCode = PhoneNumberUtil.getInstance().getCountryCodeForRegion(regionCode)
val prefixIndex = countryCodeToAdapterIndex(countryCode)
store.update {
it.copy(
countryPrefixIndex = prefixIndex,
phoneNumberRegionCode = regionCode,
country = existingCountry ?: Country(
name = PhoneNumberFormatter.getRegionDisplayName(regionCode).orElse(""),
emoji = CountryUtils.countryToEmoji(regionCode),

View File

@@ -67,9 +67,12 @@ class EnterPhoneNumberViewModel : ViewModel() {
}
val countryCode = PhoneNumberUtil.getInstance().getCountryCodeForRegion(regionCode)
val prefixIndex = countryCodeToAdapterIndex(countryCode)
store.update {
it.copy(
countryPrefixIndex = prefixIndex,
phoneNumberRegionCode = regionCode,
country = existingCountry ?: Country(
name = PhoneNumberFormatter.getRegionDisplayName(regionCode).orElse(""),
emoji = CountryUtils.countryToEmoji(regionCode),