File tree Expand file tree Collapse file tree
app/src/main/java/com/getcode/view/login Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ internal fun PhoneVerify(
152152 contract = ActivityResultContracts .StartIntentSenderForResult ()
153153 ) {
154154 if (it.resultCode != Activity .RESULT_OK ) {
155+ viewModel.dismissedHint()
155156 return @rememberLauncherForActivityResult
156157 }
157158
@@ -161,13 +162,13 @@ internal fun PhoneVerify(
161162 viewModel.setPhoneFromHint(phoneNum)
162163 }
163164
164- LaunchedEffect (phoneNumberHintLauncher ) {
165+ LaunchedEffect (dataState.hasDismissedHint ) {
165166 val request = GetPhoneNumberHintIntentRequest
166167 .builder()
167168 .build()
168169
169170 val isSettled = navigator.lastItem == navigator.lastModalItem || arguments.isNewAccount
170- if (isSettled && dataState.phoneNumberFormatted.isEmpty()) {
171+ if (isSettled && dataState.phoneNumberFormatted.isEmpty() && ! dataState.hasDismissedHint ) {
171172 Identity .getSignInClient(context)
172173 .getPhoneNumberHintIntent(request)
173174 .addOnSuccessListener {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ data class PhoneVerifyUiModel(
5151 val entropyB64 : String? = null ,
5252 val isPhoneLinking : Boolean = false ,
5353 val isNewAccount : Boolean = false ,
54+ val hasDismissedHint : Boolean = false ,
5455)
5556
5657@HiltViewModel
@@ -87,6 +88,8 @@ class PhoneVerifyViewModel @Inject constructor(
8788 uiFlow.update { it.copy(isNewAccount = isNewAccount) }
8889 }
8990
91+ fun dismissedHint () = uiFlow.update { it.copy(hasDismissedHint = true ) }
92+
9093 fun setCountryCode (countryLocale : PhoneUtils .CountryLocale ) {
9194 uiFlow.update { it.copy(countryLocale = countryLocale) }
9295 }
You can’t perform that action at this time.
0 commit comments