NTP-15803 | Vedant Aggarwal | Increasing debounce time on Pay button click to avoid multiple payments (#13821)
This commit is contained in:
@@ -69,6 +69,7 @@ fun ThemeRoundedButton(
|
||||
disabledBackgroundColor: Color = NaviPayColor.ctaDisabled,
|
||||
overflow: TextOverflow = TextOverflow.Clip,
|
||||
maxLines: Int = Int.MAX_VALUE,
|
||||
debounceTime: Long? = 300L,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
|
||||
@@ -76,7 +77,7 @@ fun ThemeRoundedButton(
|
||||
|
||||
Button(
|
||||
elevation = ButtonDefaults.elevation(defaultElevation = 0.dp),
|
||||
onClick = { clickDebounce.processClick { onClick() } },
|
||||
onClick = { clickDebounce.processClick(debounceTime = debounceTime) { onClick() } },
|
||||
modifier = modifier,
|
||||
shape = RoundedCornerShape(cornerRadius),
|
||||
contentPadding = paddingValues,
|
||||
|
||||
@@ -51,6 +51,7 @@ fun RequestApprovalSection(
|
||||
enabled =
|
||||
(bankAccountsState is BankAccountsState.AccountList) &&
|
||||
mainCtaState !is SendMoneyMainCtaState.Disabled,
|
||||
debounceTime = 800L
|
||||
) {
|
||||
when (mainCtaState) {
|
||||
is SendMoneyMainCtaState.Pay -> onApproveClicked()
|
||||
|
||||
@@ -124,7 +124,8 @@ fun SendMoneyAccountSelectionView(
|
||||
paddingValues = PaddingValues(16.dp),
|
||||
enabled = mainCtaState !is SendMoneyMainCtaState.Disabled,
|
||||
lottieFileName = NAVI_PAY_PRIMARY_CTA_LOADER_LOTTIE,
|
||||
showLoader = showPayButtonLoader
|
||||
showLoader = showPayButtonLoader,
|
||||
debounceTime = 800L
|
||||
) {
|
||||
when (mainCtaState) {
|
||||
is SendMoneyMainCtaState.Pay -> onPayButtonClick("BottomSheetPayButton")
|
||||
|
||||
@@ -98,6 +98,7 @@ private fun PayButton(
|
||||
enabled = mainCtaState !is SendMoneyMainCtaState.Disabled,
|
||||
lottieFileName = NAVI_PAY_PRIMARY_CTA_LOADER_LOTTIE,
|
||||
showLoader = showPayButtonLoader,
|
||||
debounceTime = 800L,
|
||||
loaderStatePaddingValues = PaddingValues(10.dp)
|
||||
) {
|
||||
when (mainCtaState) {
|
||||
|
||||
@@ -133,7 +133,8 @@ fun AddBalanceModalContent(
|
||||
enabled =
|
||||
(mainCtaState is UpiLiteMainCtaState.SetPin) || isCtaBottomSheetButtonActive,
|
||||
showLoader = enableButtonLottie,
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 16.dp)
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 16.dp),
|
||||
debounceTime = 800L
|
||||
) {
|
||||
when (mainCtaState) {
|
||||
is UpiLiteMainCtaState.AddBalance ->
|
||||
|
||||
@@ -570,7 +570,7 @@ fun UpiLiteSection(
|
||||
enabled = isMainCtaEnabled,
|
||||
showLoader = enableButtonLottie,
|
||||
modifier = Modifier.weight(1f).height(48.dp),
|
||||
debounceTime = 300L,
|
||||
debounceTime = 800L,
|
||||
) {
|
||||
when (mainCtaState) {
|
||||
is UpiLiteMainCtaState.AddBalance,
|
||||
|
||||
Reference in New Issue
Block a user