Updated on 2026-08-14
This commit is contained in:
parent
7703758e56
commit
65840babb1
5 changed files with 21 additions and 1 deletions
|
|
@ -75,6 +75,8 @@ internal interface StakingClickIntents : AmountScreenClickIntents {
|
|||
|
||||
fun onActivateTonAccountNotificationShow()
|
||||
|
||||
fun onNotEnoughFeeNotificationShow()
|
||||
|
||||
fun onActivateTonAccountClick()
|
||||
|
||||
fun onAmountReduceByFeeClick(reduceAmount: BigDecimal, notification: Class<out NotificationUM>)
|
||||
|
|
|
|||
|
|
@ -1120,6 +1120,14 @@ internal class StakingModel @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
override fun onNotEnoughFeeNotificationShow() {
|
||||
analyticsEventHandler.send(
|
||||
StakingAnalyticsEvent.NotEnoughFee(
|
||||
token = cryptoCurrencyStatus.currency.symbol,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
override fun onActivateTonAccountClick() {
|
||||
analyticsEventHandler.send(
|
||||
StakingAnalyticsEvent.ButtonActivate(
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ internal object StakingClickIntentsStub : StakingClickIntents {
|
|||
|
||||
override fun onActivateTonAccountNotificationShow() {}
|
||||
|
||||
override fun onNotEnoughFeeNotificationShow() {}
|
||||
|
||||
override fun onActivateTonAccountClick() {}
|
||||
|
||||
override fun onAmountReduceByFeeClick(reduceAmount: BigDecimal, notification: Class<out NotificationUM>) {}
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ internal class AddStakingNotificationsTransformer(
|
|||
isSubtractionAvailable = isSubtractAvailable,
|
||||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
onClick = prevState.clickIntents::openTokenDetails,
|
||||
onNotEnoughFeeNotificationShow = prevState.clickIntents::onNotEnoughFeeNotificationShow,
|
||||
)
|
||||
addTonExtraFeeErrorNotification()
|
||||
addExceedsBalanceNotification(
|
||||
|
|
@ -233,7 +234,7 @@ internal class AddStakingNotificationsTransformer(
|
|||
cryptoCurrencyStatus = cryptoCurrencyStatus,
|
||||
shouldMergeFeeNetworkName = BlockchainUtils.isArbitrum(network.backendId),
|
||||
onClick = prevState.clickIntents::openTokenDetails,
|
||||
onAnalyticsEvent = { /* no-op */ },
|
||||
onAnalyticsEvent = { prevState.clickIntents.onNotEnoughFeeNotificationShow() },
|
||||
)
|
||||
if (!BlockchainUtils.isCardano(network.rawId)) {
|
||||
addDustWarningNotification(
|
||||
|
|
@ -298,12 +299,14 @@ internal class AddStakingNotificationsTransformer(
|
|||
isSubtractionAvailable: Boolean,
|
||||
cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
onClick: (CryptoCurrency) -> Unit,
|
||||
onNotEnoughFeeNotificationShow: () -> Unit,
|
||||
) {
|
||||
val balance = cryptoCurrencyStatus.value.amount.orZero()
|
||||
if (!isSubtractionAvailable) return
|
||||
|
||||
val showNotification = sendingAmount + feeAmount > balance
|
||||
if (showNotification) {
|
||||
onNotEnoughFeeNotificationShow()
|
||||
val notification = if (actionType is StakingActionCommonType.Enter) {
|
||||
NotificationUM.Error.TotalExceedsBalance
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue