NTP-9378 | Sohan Reddy | Fixed ripple in pending bills section (#13577)
This commit is contained in:
committed by
GitHub
parent
3f2c0f90be
commit
daf3f55a19
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user