NTP-325 | Sohan Reddy | Fix for redemption not working as expected (#11361)
Co-authored-by: Kishan Kumar <kishan.kumar@navi.com>
This commit is contained in:
committed by
GitHub
parent
7972617800
commit
bdc76b017e
@@ -314,6 +314,14 @@ constructor(
|
||||
onFailure: suspend () -> Unit,
|
||||
) {
|
||||
val redemptionInfo = coinHomeScreenRepo.getRedemptionInfo()
|
||||
if (redemptionInfo.isValidResponse().not()) {
|
||||
onFailure()
|
||||
showError(
|
||||
RRErrorData(statusCode = redemptionInfo.statusCode ?: ApiConstants.API_BAD_REQUEST)
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
val cashRedemptionData = redemptionInfo.data?.firstOrNull { it.isCashRedemption() }
|
||||
|
||||
val redeemableCoin = cashRedemptionData?.config?.maxRedemptionCoin
|
||||
@@ -330,11 +338,11 @@ constructor(
|
||||
|
||||
if (redeemCoinsResponse.isValidResponse().not()) {
|
||||
onFailure()
|
||||
redeemCoinsResponse.let { response ->
|
||||
showError(
|
||||
RRErrorData(statusCode = response.statusCode ?: ApiConstants.API_BAD_REQUEST)
|
||||
showError(
|
||||
RRErrorData(
|
||||
statusCode = redeemCoinsResponse.statusCode ?: ApiConstants.API_BAD_REQUEST
|
||||
)
|
||||
}
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -432,6 +440,7 @@ constructor(
|
||||
} else {
|
||||
handleActions(apiAction.onFailure)
|
||||
_apiActionState.emit(ApiActionState.FAILURE)
|
||||
fetchCoinHomeScreenUiTronConfigs(shouldRefresh = true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user