NTP-62752 | Shiv Natani | nps amount flicker fix (#16132)
This commit is contained in:
@@ -254,68 +254,63 @@ constructor(
|
||||
(it as? S2sPaymentMethodResponse)?.let { paymentMethodResponse ->
|
||||
updateBaseAnalyticParams(paymentMethodResponse)
|
||||
_state.update {
|
||||
var npsScreenState = it as NPSScreenContract.NPSScreenState
|
||||
// Considering direct NPS flow from pay bill screen as well
|
||||
val isDiscountPreApplied =
|
||||
paymentDataProvider.isDiscountPreApplied.value ||
|
||||
paymentSdkInitParams?.rewardsInfo?.burnDetails?.isOfferApplied.orFalse()
|
||||
npsScreenState =
|
||||
npsScreenState.copy(
|
||||
npsBaseState =
|
||||
npsScreenState.npsBaseState.copy(
|
||||
paymentAmount =
|
||||
paymentMethodResponse.methodDetails?.amount?.value.orZero(),
|
||||
isCtaLoaderEnabled = false,
|
||||
),
|
||||
isLoading = false,
|
||||
naviCoinState =
|
||||
npsScreenState.naviCoinState.copy(
|
||||
coinBurnDetails =
|
||||
paymentMethodResponse.methodDetails?.coinDetails,
|
||||
coinEarnBannerDetails =
|
||||
paymentMethodResponse.methodDetails
|
||||
?.bannerDetails
|
||||
?.coinRewards,
|
||||
isDiscountApplied = isDiscountPreApplied,
|
||||
showDiscountApplyLottie = false,
|
||||
showDiscountedAmount = isDiscountPreApplied,
|
||||
fomoBottomSheetDetails =
|
||||
paymentMethodResponse.methodDetails?.fomoBottomSheetDetails,
|
||||
isDiscountPreApplied = isDiscountPreApplied,
|
||||
rewardsInfoV2 =
|
||||
if (
|
||||
paymentSdkInitParams?.rewardsInfo?.isEnabled.orFalse()
|
||||
) {
|
||||
naviPaymentAnalytics.onOfferExperienceBannerShown(
|
||||
rewardsInfoV2 = paymentSdkInitParams?.rewardsInfo,
|
||||
baseAttributes = baseAnalyticsParams,
|
||||
)
|
||||
RewardsInfoV2(
|
||||
earnDetails =
|
||||
paymentSdkInitParams?.rewardsInfo?.earnDetails,
|
||||
burnDetails =
|
||||
paymentSdkInitParams?.rewardsInfo?.burnDetails,
|
||||
)
|
||||
} else null,
|
||||
discountApplyCount =
|
||||
if (paymentDataProvider.isDiscountApplyLottieShown.value) 2
|
||||
else 0,
|
||||
),
|
||||
)
|
||||
npsScreenState =
|
||||
processAvailablePaymentMethods(
|
||||
npsScreenState,
|
||||
paymentMethodResponse.methodDetails
|
||||
?.availablePaymentInstruments
|
||||
.orEmpty(),
|
||||
)
|
||||
npsScreenState.copy(
|
||||
npsBaseState =
|
||||
npsScreenState.npsBaseState.copy(
|
||||
mainCtaState = getMainCtaState(npsScreenState)
|
||||
paymentAmount =
|
||||
paymentMethodResponse.methodDetails?.amount?.value.orZero(),
|
||||
isCtaLoaderEnabled = false,
|
||||
)
|
||||
)
|
||||
}
|
||||
_state.update {
|
||||
val isDiscountPreApplied =
|
||||
paymentDataProvider.isDiscountPreApplied.value ||
|
||||
paymentSdkInitParams?.rewardsInfo?.burnDetails?.isOfferApplied.orFalse()
|
||||
npsScreenState.copy(
|
||||
naviCoinState =
|
||||
npsScreenState.naviCoinState.copy(
|
||||
coinBurnDetails = paymentMethodResponse.methodDetails?.coinDetails,
|
||||
coinEarnBannerDetails =
|
||||
paymentMethodResponse.methodDetails?.bannerDetails?.coinRewards,
|
||||
isDiscountApplied = isDiscountPreApplied,
|
||||
showDiscountApplyLottie = false,
|
||||
showDiscountedAmount = isDiscountPreApplied,
|
||||
fomoBottomSheetDetails =
|
||||
paymentMethodResponse.methodDetails?.fomoBottomSheetDetails,
|
||||
isDiscountPreApplied = isDiscountPreApplied,
|
||||
rewardsInfoV2 =
|
||||
if (paymentSdkInitParams?.rewardsInfo?.isEnabled.orFalse()) {
|
||||
naviPaymentAnalytics.onOfferExperienceBannerShown(
|
||||
rewardsInfoV2 = paymentSdkInitParams?.rewardsInfo,
|
||||
baseAttributes = baseAnalyticsParams,
|
||||
)
|
||||
RewardsInfoV2(
|
||||
earnDetails =
|
||||
paymentSdkInitParams?.rewardsInfo?.earnDetails,
|
||||
burnDetails =
|
||||
paymentSdkInitParams?.rewardsInfo?.burnDetails,
|
||||
)
|
||||
} else null,
|
||||
discountApplyCount =
|
||||
if (paymentDataProvider.isDiscountApplyLottieShown.value) 2
|
||||
else 0,
|
||||
)
|
||||
)
|
||||
}
|
||||
_state.update {
|
||||
processAvailablePaymentMethods(
|
||||
npsScreenState,
|
||||
paymentMethodResponse.methodDetails?.availablePaymentInstruments.orEmpty(),
|
||||
)
|
||||
}
|
||||
_state.update {
|
||||
npsScreenState.copy(
|
||||
npsBaseState =
|
||||
npsScreenState.npsBaseState.copy(mainCtaState = getMainCtaState()),
|
||||
isLoading = false,
|
||||
)
|
||||
}
|
||||
handleLiteAccountEligibilityStateForDiscount(
|
||||
paymentDataProvider.isDiscountPreApplied.value
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user