Skip to content

Commit

Permalink
CC link OTP check key changed to HIP ID
Browse files Browse the repository at this point in the history
  • Loading branch information
RawatH committed Oct 1, 2023
1 parent 65c7b69 commit 775fd06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,20 @@ class CCVerifyOtpFragment : BaseFragment<GenerateCCOtpBinding>(GenerateCCOtpBind

private fun requestOtp() {
lifecycleScope.launch {
viewModel.checkForBlockedState(CareContextViewModel.CC_OTP_KEY).collect {
when (it) {
OtpCallState.OtpReqAvailable -> {
viewModel.generateCareContextOtp()
}
viewModel.linkCareContextModel.hipId.let {hipId ->
viewModel.checkForBlockedState(hipId).collect {
when (it) {
OtpCallState.OtpReqAvailable -> {
viewModel.generateCareContextOtp()
}

is OtpCallState.OtpReqBlocked -> {
viewModel.otpRequestBlocked.value = it.otpRequestCallModel
binding.resendCCOtp.isEnabled = false
is OtpCallState.OtpReqBlocked -> {
viewModel.otpRequestBlocked.value = it.otpRequestCallModel
binding.resendCCOtp.isEnabled = false
}
}
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ class CareContextViewModel @Inject constructor(
lateinit var selectedAuthMethod: String
lateinit var confirmAuthModel: ConfirmAuthModel

companion object{
val CC_OTP_KEY ="cc_otp_key"
}



fun init(model: LinkCareContextModel) {
linkCareContextModel = model
Expand Down Expand Up @@ -104,7 +99,7 @@ class CareContextViewModel @Inject constructor(
selectedAuthMethod.let { authMethod ->
linkCareContextModel.getAuthModesRequestModel(authMethod)?.let { ccAuthReqModel ->
//save otp req call count
saveOtpRequestCallCount(CC_OTP_KEY)
saveOtpRequestCallCount(linkCareContextModel.hipId)

generateCareContextOtpUsecase.execute(ccAuthReqModel).collect { hqRespModel ->
when (hqRespModel) {
Expand Down

0 comments on commit 775fd06

Please sign in to comment.