TP-35898 | Added changes for failiure and timeout massage (#7261)
This commit is contained in:
@@ -28,6 +28,7 @@ import com.navi.common.ui.activity.BaseActivity
|
||||
import com.navi.common.utils.ApiPollScheduler
|
||||
import com.navi.common.utils.getNetworkType
|
||||
import com.navi.design.font.FontWeightEnum
|
||||
import com.navi.insurance.eia.state.EIAResponseState
|
||||
import com.navi.naviwidgets.extensions.setTextFieldData
|
||||
import com.navi.naviwidgets.models.response.TextFieldData
|
||||
import com.navi.naviwidgets.utils.FORWARD_SLASH
|
||||
@@ -223,7 +224,21 @@ class AccountAggregatorActivity : BaseActivity() {
|
||||
)
|
||||
)
|
||||
)
|
||||
redirectUsingFailureCta()
|
||||
failureErrorMessage?.let {
|
||||
showFullScreenError(
|
||||
errorData = failureErrorMessage,
|
||||
screenName = screenName,
|
||||
dialogDismissClicked = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
dialogOnBackPressed = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
moduleName = moduleName
|
||||
)
|
||||
} ?: kotlin.run {
|
||||
redirectUsingFailureCta()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,32 +272,45 @@ class AccountAggregatorActivity : BaseActivity() {
|
||||
|
||||
launch {
|
||||
finarkeinViewModel.timeOutData.collect { isTimeOut ->
|
||||
handlePollingTimeout(isTimeOut)
|
||||
if(isTimeOut) {
|
||||
handlePollingTimeout()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePollingTimeout(isTimeOut: Boolean) {
|
||||
if (isTimeOut) {
|
||||
releaseListeners()
|
||||
binding.progressLayout.visibility = View.GONE
|
||||
showFullScreenError(
|
||||
errorData = finarkeinViewModel.getTimeOutErrorData(
|
||||
private fun handlePollingTimeout() {
|
||||
releaseListeners()
|
||||
binding.progressLayout.visibility = View.GONE
|
||||
val errorData = if (finarkeinViewModel.finarkeinStatusResponse.value is FinarkeinStatusResponseState.Update) {
|
||||
(finarkeinViewModel.finarkeinStatusResponse.value as FinarkeinStatusResponseState.Update).let {
|
||||
it.data?.timeoutErrorMessage
|
||||
} ?: run {
|
||||
finarkeinViewModel.getTimeOutErrorData(
|
||||
getString(R.string.retry),
|
||||
getString(R.string.bank_detail_fetch_failed_try_again),
|
||||
getString(R.string.could_not_fetch_bank_details)
|
||||
),
|
||||
screenName = screenName,
|
||||
dialogDismissClicked = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
dialogOnBackPressed = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
moduleName = moduleName
|
||||
)
|
||||
}
|
||||
} else {
|
||||
finarkeinViewModel.getTimeOutErrorData(
|
||||
getString(R.string.retry),
|
||||
getString(R.string.bank_detail_fetch_failed_try_again),
|
||||
getString(R.string.could_not_fetch_bank_details)
|
||||
)
|
||||
}
|
||||
showFullScreenError(
|
||||
errorData = errorData,
|
||||
screenName = screenName,
|
||||
dialogDismissClicked = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
dialogOnBackPressed = {
|
||||
redirectUsingFailureCta()
|
||||
},
|
||||
moduleName = moduleName
|
||||
)
|
||||
}
|
||||
|
||||
private fun redirectUsingFailureCta() {
|
||||
|
||||
@@ -10,6 +10,7 @@ package com.naviapp.account_aggregator.models
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navi.base.model.CtaData
|
||||
import com.navi.common.model.UploadDataAsyncResponse
|
||||
import com.navi.common.network.models.GenericErrorResponse
|
||||
|
||||
data class FinarkeinStatusResponse(
|
||||
@SerializedName("requestDetail")
|
||||
@@ -17,5 +18,9 @@ data class FinarkeinStatusResponse(
|
||||
@SerializedName("successCta")
|
||||
val successCta: CtaData? = null,
|
||||
@SerializedName("failureCta")
|
||||
val failureCta: CtaData? = null
|
||||
val failureCta: CtaData? = null,
|
||||
@SerializedName("timeoutErrorMessage")
|
||||
val timeoutErrorMessage: GenericErrorResponse? = null,
|
||||
@SerializedName("failureErrorMessage")
|
||||
val failureErrorMessage: GenericErrorResponse? = null
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user