Updated on 2026-08-14
This commit is contained in:
commit
a37a8d866a
3 changed files with 18 additions and 6 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 985642c135606ba1f59fd739127aec03024da79b
|
||||
Subproject commit 64ae04d2086e5a605dd4da3cba4af32a60d46c79
|
||||
|
|
@ -31,6 +31,7 @@ import com.tangem.tap.features.demo.DemoHelper
|
|||
import com.tangem.tap.features.home.redux.HomeAction
|
||||
import com.tangem.tap.features.send.redux.PrepareSendScreen
|
||||
import com.tangem.tap.features.wallet.models.PendingTransactionType
|
||||
import com.tangem.tap.features.wallet.models.filterByCoin
|
||||
import com.tangem.tap.features.wallet.models.getPendingTransactions
|
||||
import com.tangem.tap.features.wallet.models.getSendableAmounts
|
||||
import com.tangem.tap.features.wallet.redux.Currency
|
||||
|
|
@ -332,7 +333,10 @@ class WalletMiddleware {
|
|||
}
|
||||
|
||||
val balance = walletManager.wallet.fundsAvailable(AmountType.Coin)
|
||||
val outgoingTxs = walletManager.wallet.getPendingTransactions(PendingTransactionType.Outgoing)
|
||||
val outgoingTxs = walletManager.wallet.getPendingTransactions(
|
||||
PendingTransactionType.Outgoing
|
||||
).filterByCoin()
|
||||
|
||||
val rentExempt = result.data
|
||||
val show = if (outgoingTxs.isEmpty()) {
|
||||
isNeedToShowWarning(balance, rentExempt)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.tangem.tap.common.extensions.toFiatString
|
|||
import com.tangem.tap.common.extensions.toFormattedCurrencyString
|
||||
import com.tangem.tap.domain.getFirstToken
|
||||
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
|
||||
import com.tangem.tap.features.wallet.models.WalletRent
|
||||
import com.tangem.tap.features.wallet.models.filterByToken
|
||||
import com.tangem.tap.features.wallet.models.getPendingTransactions
|
||||
import com.tangem.tap.features.wallet.models.removeUnknownTransactions
|
||||
|
|
@ -102,10 +103,10 @@ class MultiWalletReducer {
|
|||
}
|
||||
is WalletAction.MultiWallet.TokenLoaded -> {
|
||||
val currency = Currency.fromBlockchainNetwork(action.blockchain, action.token)
|
||||
val wallet = state.getWalletManager(currency)?.wallet.guard {
|
||||
throw NullPointerException("MultiWallet.TokenLoaded: WalletManager must be no NULL")
|
||||
val walletManager = state.getWalletManager(currency).guard {
|
||||
throw NullPointerException("MultiWallet.TokenLoaded: WalletManager must be not NULL")
|
||||
}
|
||||
|
||||
val wallet = walletManager.wallet
|
||||
val pendingTransactions = wallet.getPendingTransactions()
|
||||
val tokenPendingTransactions = pendingTransactions.filterByToken(action.token)
|
||||
val tokenBalanceStatus = when {
|
||||
|
|
@ -136,7 +137,8 @@ class MultiWalletReducer {
|
|||
token = action.token,
|
||||
blockchain = action.blockchain.blockchain,
|
||||
derivationPath = action.blockchain.derivationPath
|
||||
)
|
||||
),
|
||||
walletRent = findWalletRent(state.getWalletStore(walletManager.wallet))
|
||||
)
|
||||
state.updateWalletData(newTokenWalletData)
|
||||
}
|
||||
|
|
@ -159,6 +161,12 @@ class MultiWalletReducer {
|
|||
is WalletAction.MultiWallet.SaveCurrencies -> state
|
||||
}
|
||||
}
|
||||
|
||||
private fun findWalletRent(walletStore: WalletStore?): WalletRent? {
|
||||
return walletStore?.walletsData?.firstOrNull {
|
||||
it.walletRent != null
|
||||
}?.walletRent
|
||||
}
|
||||
}
|
||||
|
||||
private fun addTokens(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue