NTP-39209 | bug fix auto read otp (#15452)

This commit is contained in:
Shaurya Rehan
2025-03-19 20:09:38 +05:30
committed by GitHub
parent 6a333f12c3
commit 21d34e7e27
2 changed files with 10 additions and 8 deletions

View File

@@ -160,6 +160,10 @@ class OtpFragment : BaseFragment(), View.OnClickListener {
private fun initObservers() {
registrationVM.loginOtpVerifyResponse.observeNonNull(this) { otpVerifyResponse ->
if (otpVerifyResponse.idToken.isNotNullAndNotEmpty()) {
PreferenceManager.setBooleanSecurely(
key = AUTO_READ_OTP_CONSENT_KEY,
value = otpAutofill,
)
loginListener.login(
loginRequest =
UserLoginRequest(
@@ -362,10 +366,6 @@ class OtpFragment : BaseFragment(), View.OnClickListener {
}
private fun verifyOtp(isAutoFetchOtp: Boolean = false) {
PreferenceManager.setBooleanSecurely(
key = AUTO_READ_OTP_CONSENT_KEY,
value = isAutoFetchOtp,
)
otpAutofill = isAutoFetchOtp
if (
System.currentTimeMillis() - apiCallLastTime <=

View File

@@ -1770,10 +1770,6 @@ constructor(
updateAutoReadOtpVerificationState(AutoReadOtpVerificationState.VERIFYING)
otpTimerJob?.cancel()
updateOtpTimeOut(otpTimeOut = 30)
sharedPreferenceRepository.setBooleanValueSecurely(
key = AUTO_READ_OTP_CONSENT_KEY,
value = true,
)
val verifyOtpResponse =
naviCommonRepository.verifyOtp(
@@ -1803,6 +1799,12 @@ constructor(
)
return@launch
}
sharedPreferenceRepository.setBooleanValueSecurely(
key = AUTO_READ_OTP_CONSENT_KEY,
value = true,
)
startSimBinding()
}
}