NTP-9378 | Sohan Reddy | Fixed ripple in pending bills section (#13577)

This commit is contained in:
Sohan Reddy Atukula
2024-11-15 18:56:33 +05:30
committed by GitHub
parent 3f2c0f90be
commit daf3f55a19
5 changed files with 20 additions and 13 deletions

View File

@@ -51,7 +51,8 @@ interface NaviCacheRepository {
return currentData.version == altData.version &&
currentDataValue.hashCode() == altDataValue.hashCode()
},
emitMultipleValues: Boolean = false
emitMultipleValues: Boolean = false,
emitOnFailure: Boolean = false,
): Flow<NaviCacheEntity?>
fun getDataAndFetchFromAltSourceWithSimilarityCheck(
@@ -166,7 +167,8 @@ class NaviCacheRepositoryImpl @Inject constructor(private val naviCacheDao: Navi
getDataFromAltSource: suspend () -> NaviCacheAltSourceEntity,
isCurrentAndAltDataSame:
(currentData: NaviCacheEntity?, altData: NaviCacheAltSourceEntity) -> Boolean,
emitMultipleValues: Boolean
emitMultipleValues: Boolean,
emitOnFailure: Boolean
) = flow {
var isValueEmitted = false
@@ -183,6 +185,9 @@ class NaviCacheRepositoryImpl @Inject constructor(private val naviCacheDao: Navi
!naviCacheValueEntityFromAltSource.isSuccess ||
naviCacheValueEntityFromAltSource.value == null
) { // alternate source data invalid
if (emitOnFailure) {
emit(null)
}
return@flow
}

View File

@@ -123,7 +123,8 @@ constructor(
isCurrentAndAltDataSame = { currentData, altData ->
currentData?.version == altData.version && currentData?.value == altData.value
},
emitMultipleValues = true
emitMultipleValues = true,
emitOnFailure = true
)
.collect { categories ->
val parsedCategories =

View File

@@ -678,25 +678,26 @@ private fun PendingBillItemV2(
getReminderTitleFromMyBillEntity: (MyBillEntity) -> String
) {
Box(modifier = modifier) {
Card(
Box(
modifier =
Modifier.fillMaxWidth()
.clickableDebounce { onPendingBillClicked(myBillEntity) }
.border(
width = 1.dp,
color = NaviBbpsColor.borderAlt,
shape = RoundedCornerShape(4.dp)
)
.shadow(
shape = RoundedCornerShape(4.dp),
elevation = 16.dp,
ambientColor = Color.Black,
spotColor = Color(0x4DD1D9E6),
clip = false
),
shape = RoundedCornerShape(4.dp),
elevation = 0.dp,
border = BorderStroke(width = 1.dp, color = NaviBbpsColor.borderAlt),
backgroundColor = NaviBbpsColor.bgDefault
)
.background(color = NaviBbpsColor.textWhite, shape = RoundedCornerShape(4.dp)),
) {
Row(
modifier =
Modifier.fillMaxWidth()
.clickableDebounce { onPendingBillClicked(myBillEntity) }
.padding(horizontal = NaviBbpsDimens.horizontalMargin, vertical = 14.dp),
verticalAlignment = Alignment.CenterVertically
) {

View File

@@ -64,7 +64,7 @@ constructor(
try {
_helpCenterProductList.postValue(
getGsonDeserializerForWidgetizedResponse()
.fromJson(it.value, HelpCenterResponse::class.java)
.fromJson(it?.value, HelpCenterResponse::class.java)
)
} catch (e: Exception) {
e.log()

View File

@@ -62,7 +62,7 @@ constructor(
try {
_supportItemList.postValue(
getGsonBuilderForWidgetizedResponse()
.fromJson(it.value, SupportScreenResponse::class.java)
.fromJson(it?.value, SupportScreenResponse::class.java)
)
} catch (e: Exception) {
e.log()