NTP-39209 | bug fix auto read otp (#15452)
This commit is contained in:
@@ -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 <=
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user