Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-27 09:19:28 +03:00
commit bab4923434
283 changed files with 1541 additions and 11004 deletions

View file

@ -1,6 +1,6 @@
package com.tangem.features.staking.impl.presentation.state.events
import com.tangem.common.ui.alerts.SendTransactionAlertConverter
import com.tangem.common.ui.alerts.TransactionErrorAlertConverter
import com.tangem.domain.staking.model.stakekit.StakingError
import com.tangem.domain.transaction.error.SendTransactionError
import com.tangem.features.staking.impl.presentation.state.StakingStateController
@ -22,7 +22,7 @@ internal class StakingEventFactory(
fun createSendTransactionErrorAlert(error: SendTransactionError?) {
val alert = error?.let {
SendTransactionAlertConverter(
TransactionErrorAlertConverter(
popBackStack = popBackStack,
onFailedTxEmailClick = onFailedTxEmailClick,
).convert(error)

View file

@ -136,13 +136,11 @@ internal class AddStakingNotificationsTransformer(
val cryptoCurrency = cryptoCurrencyStatus.currency
val network = cryptoCurrency.network
if (feeError != null) {
addFeeUnreachableNotification(
feeError = feeError,
tokenName = cryptoCurrencyStatusProvider().currency.name,
onReload = onReload,
)
}
addFeeUnreachableNotification(
feeError = feeError,
tokenName = cryptoCurrencyStatusProvider().currency.name,
onReload = onReload,
)
addStakeExceedBalanceNotification(
feeAmount = feeValue,
sendingAmount = sendingAmount,

View file

@ -18,9 +18,9 @@ import com.tangem.core.ui.haptic.VibratorHapticManager
import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase
import com.tangem.domain.feedback.FeedbackManager
import com.tangem.domain.feedback.GetCardInfoUseCase
import com.tangem.domain.feedback.SaveBlockchainErrorUseCase
import com.tangem.domain.feedback.SendFeedbackEmailUseCase
import com.tangem.domain.feedback.models.BlockchainErrorInfo
import com.tangem.domain.feedback.models.FeedbackEmailType
import com.tangem.domain.staking.InvalidatePendingTransactionsUseCase
@ -92,7 +92,6 @@ internal class StakingViewModel @Inject constructor(
private val getAllowanceUseCase: GetAllowanceUseCase,
private val isApproveNeededUseCase: IsApproveNeededUseCase,
private val vibratorHapticManager: VibratorHapticManager,
private val feedbackManager: FeedbackManager,
private val getCardInfoUseCase: GetCardInfoUseCase,
private val saveBlockchainErrorUseCase: SaveBlockchainErrorUseCase,
private val getBalanceNotEnoughForFeeWarningUseCase: GetBalanceNotEnoughForFeeWarningUseCase,
@ -105,6 +104,7 @@ internal class StakingViewModel @Inject constructor(
private val stakingFeeTransactionLoader: StakingFeeTransactionLoader.Factory,
private val stakingBalanceUpdater: StakingBalanceUpdater.Factory,
private val analyticsEventHandler: AnalyticsEventHandler,
private val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase,
@DelayedWork private val coroutineScope: CoroutineScope,
savedStateHandle: SavedStateHandle,
) : ViewModel(), DefaultLifecycleObserver, StakingClickIntents {
@ -723,7 +723,7 @@ internal class StakingViewModel @Inject constructor(
unsignedTransactions = transactionsInProgress.map { it.unsignedTransaction },
)
feedbackManager.sendEmail(email)
sendFeedbackEmailUseCase(email)
}
}