Updated on 2026-08-14

This commit is contained in:
Tangem 2021-04-07 17:05:08 +03:00
parent a125e2c530
commit b578df9cc7
2 changed files with 2 additions and 5 deletions

View file

@ -54,7 +54,6 @@ class MultiWalletMiddleware {
is WalletAction.MultiWallet.FindTokensInUse -> {
val walletManager = walletState?.getWalletManager(Blockchain.Ethereum.currency)
?: return
val alreadyAddedTokens = walletManager.presetTokens
val tokenFinder = walletManager as TokenFinder
scope.launch {
val result = tokenFinder.findTokens()
@ -63,9 +62,7 @@ class MultiWalletMiddleware {
is Result.Success -> {
if (result.data.isNotEmpty()) {
store.dispatch(WalletAction.MultiWallet.AddTokens(
walletManager.presetTokens
.filterNot { presetToken -> alreadyAddedTokens.any { it.symbol == presetToken.symbol } }
.toList()
walletManager.presetTokens.toList()
))
}
}

View file

@ -90,7 +90,7 @@ class MultiWalletReducer {
token = token
)
}
state.copy(wallets = state.wallets + wallets)
state.copy(wallets = state.replaceSomeWallets(wallets))
}
is WalletAction.MultiWallet.AddToken -> {
if (!state.isMultiwalletAllowed) return state