NTP-63988 | Shiv Natani | one cc bug fix (#16171)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * Copyright © 2024-2025 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -33,4 +33,5 @@ object NaviPmsColor {
|
||||
val coinBurnV2Gradient1 = Color(0XFF22A940)
|
||||
val coinBurnV2Gradient2 = Color(0XFF115520)
|
||||
val coinExchangeBannerBg = Color(0xFFEAFBEE)
|
||||
val secondaryCtaDisabledTextColor = Color(0xFFAAAAAA)
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ import com.navi.pay.utils.isAccountIdOfTypeUpiLite
|
||||
import com.navi.pay.utils.noRippleClickableWithDebounce
|
||||
import com.navi.pay.utils.pxToDp
|
||||
import com.navi.payment.R
|
||||
import com.navi.payment.nativepayment.common.theme.NaviPmsColor
|
||||
import com.navi.payment.nativepayment.model.OneClickCheckoutFooterBottomSheetUiState
|
||||
import com.navi.payment.nativepayment.model.PaymentsMainCtaState
|
||||
import com.navi.payment.nativepayment.model.RewardsInfoV2
|
||||
@@ -802,7 +803,9 @@ fun RowScope.OtherMethodsCta(
|
||||
fontSize = 14.sp,
|
||||
fontFamily = naviFontFamily,
|
||||
fontWeight = getFontWeight(FontWeightEnum.NAVI_BODY_DEMI_BOLD),
|
||||
color = NaviPayColor.ctaPrimary,
|
||||
color =
|
||||
if (isEnabled) NaviPayColor.ctaPrimary
|
||||
else NaviPmsColor.secondaryCtaDisabledTextColor,
|
||||
letterSpacing = 0.sp,
|
||||
)
|
||||
} else {
|
||||
|
||||
@@ -216,6 +216,7 @@ constructor(
|
||||
|
||||
var screenLandTime: Long = 0
|
||||
var isAmountReadOnly: Boolean = true
|
||||
private var isOneClickCheckoutSetupDone = false
|
||||
|
||||
init {
|
||||
paymentAmountChangeListener()
|
||||
@@ -227,27 +228,30 @@ constructor(
|
||||
tenantFlowName: String,
|
||||
blacklistedMethodList: List<String> = emptyList(),
|
||||
) {
|
||||
paymentSource = source
|
||||
this.category = category
|
||||
this.tenantFlowName = tenantFlowName
|
||||
this.blacklistedMethodList = blacklistedMethodList
|
||||
pmsLinkedAccountUseCase.clear()
|
||||
viewModelScope.safeLaunch {
|
||||
val isOneClickCheckoutExperienceEnabled = isOneClickCheckoutExperienceEnabled()
|
||||
naviPaymentAnalytics.onScreenLanded(
|
||||
experimentVariantName = state.value.experimentVariantName
|
||||
)
|
||||
if (isOneClickCheckoutExperienceEnabled) {
|
||||
linkedAccountChangeObserver()
|
||||
} else {
|
||||
naviPaymentAnalytics.onFallBackToPreviousFlow(
|
||||
isOneCliCkCheckoutExperimentEnabled = false,
|
||||
baseAttributes = paymentDataProvider.getAnalyticsParams(),
|
||||
experimentVariantName = state.value.experimentVariantName,
|
||||
if (isOneClickCheckoutSetupDone.not()) {
|
||||
paymentSource = source
|
||||
this.category = category
|
||||
this.tenantFlowName = tenantFlowName
|
||||
this.blacklistedMethodList = blacklistedMethodList
|
||||
pmsLinkedAccountUseCase.clear()
|
||||
viewModelScope.safeLaunch {
|
||||
val isOneClickCheckoutExperienceEnabled = isOneClickCheckoutExperienceEnabled()
|
||||
naviPaymentAnalytics.onScreenLanded(
|
||||
experimentVariantName = state.value.experimentVariantName
|
||||
)
|
||||
_state.update { state.value.copy(isGetMethodsInProgress = false) }
|
||||
if (isOneClickCheckoutExperienceEnabled) {
|
||||
linkedAccountChangeObserver()
|
||||
} else {
|
||||
naviPaymentAnalytics.onFallBackToPreviousFlow(
|
||||
isOneCliCkCheckoutExperimentEnabled = false,
|
||||
baseAttributes = paymentDataProvider.getAnalyticsParams(),
|
||||
experimentVariantName = state.value.experimentVariantName,
|
||||
)
|
||||
_state.update { state.value.copy(isGetMethodsInProgress = false) }
|
||||
}
|
||||
updatePaymentCtaState()
|
||||
}
|
||||
updatePaymentCtaState()
|
||||
isOneClickCheckoutSetupDone = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,7 +623,7 @@ constructor(
|
||||
val accountList =
|
||||
(state.value.bankAccountsState as? BankAccountsState.AccountList)?.accounts.orEmpty()
|
||||
val selectedAccount = getFirstEligibleAccount(accountList) ?: accountList.firstOrNull()
|
||||
if (selectedAccount == state.value.selectedAccount) return
|
||||
if (selectedAccount?.accountId == state.value.selectedAccount?.accountId) return
|
||||
_state.update { state.value.copy(selectedAccount = selectedAccount) }
|
||||
selectedAccount?.let {
|
||||
if (isArcProtected) {
|
||||
|
||||
Reference in New Issue
Block a user