NTP-62422 | tstore order error query crash and bbps my bills crash fix (#16078)
This commit is contained in:
@@ -203,7 +203,7 @@ constructor(
|
||||
private val _refreshBillItemAndStatus = MutableStateFlow(RefreshBillState())
|
||||
val refreshBillItemAndStatus = _refreshBillItemAndStatus.asStateFlow()
|
||||
|
||||
private val myAllBills = mutableListOf<MyBillEntity>()
|
||||
private val myAllBills = mutableListOf<MyBillEntity?>()
|
||||
|
||||
var arcNudgeResponse: ArcNudgeResponse? = null
|
||||
|
||||
@@ -224,11 +224,11 @@ constructor(
|
||||
val openBottomSheet = _openBottomSheet.asSharedFlow()
|
||||
|
||||
init {
|
||||
viewModelScope.launch(dispatcherProvider.default) {
|
||||
viewModelScope.launch(dispatcherProvider.io) {
|
||||
initConfig()
|
||||
observeMyBillCounts(
|
||||
onFetchSuccess = {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
viewModelScope.launch(dispatcherProvider.io) {
|
||||
fetchOffersForMultipleBills(offerRequestList = getOfferRequestList())
|
||||
}
|
||||
}
|
||||
@@ -586,8 +586,7 @@ constructor(
|
||||
}
|
||||
|
||||
private fun getTotalUnpaidBills(): List<MyBillEntity> {
|
||||
val bills = myAllBills.toList()
|
||||
return bills.filter { it.isBillPaid.not() }
|
||||
return myAllBills.filterNotNull().filter { !it.isBillPaid }
|
||||
}
|
||||
|
||||
private fun updateMyUnpaidBills() {
|
||||
|
||||
@@ -1889,7 +1889,7 @@ constructor(
|
||||
errorCode = orderEntity.orderDetails.errorCode
|
||||
)
|
||||
naviPayAnalytics.onOrderErrorDetailsFetchedDevEvent(
|
||||
errorCode = orderEntity.orderDetails.errorCode,
|
||||
errorCode = orderEntity.orderDetails.errorCode.orEmpty(),
|
||||
orderErrorEntity = orderErrorEntity,
|
||||
isExperimentEnabled = isNewErrorWidgetExperimentEnabled.value,
|
||||
productType = orderEntity.productType,
|
||||
|
||||
@@ -23,6 +23,6 @@ data class OrderDetailEntity(
|
||||
@SerializedName("coinsUsed") val coinsUsed: String?,
|
||||
@SerializedName("coinEquivalentCash") val coinEquivalentCash: String?,
|
||||
@SerializedName("rewardList") val rewardList: List<RewardMetadata>? = null,
|
||||
@SerializedName("errorCode") val errorCode: String,
|
||||
@SerializedName("errorCode") val errorCode: String?,
|
||||
@SerializedName("naviUpiAccInfo") val naviUpiAccInfo: NaviUpiAccInfo?,
|
||||
) : Parcelable
|
||||
|
||||
@@ -82,9 +82,9 @@ constructor(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getErrorEntityByCode(errorCode: String): OrderErrorEntity {
|
||||
return orderRepository.getOrderErrorEntity(errorCode) ?: getDefaultError()
|
||||
}
|
||||
suspend fun getErrorEntityByCode(errorCode: String?): OrderErrorEntity =
|
||||
errorCode?.takeIf { it.isNotBlank() }?.let { orderRepository.getOrderErrorEntity(it) }
|
||||
?: getDefaultError()
|
||||
|
||||
private fun getDefaultError() =
|
||||
OrderErrorEntity(
|
||||
|
||||
Reference in New Issue
Block a user