Updated on 2026-08-14
This commit is contained in:
parent
d9e745fbc6
commit
ac620f6c21
1 changed files with 6 additions and 10 deletions
|
|
@ -29,7 +29,6 @@ import com.tangem.tap.domain.extensions.makeWalletManagerForApp
|
|||
import com.tangem.tap.domain.tokens.BlockchainNetwork
|
||||
import com.tangem.tap.features.wallet.redux.Currency
|
||||
import com.tangem.tap.features.wallet.redux.WalletAction
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import org.rekotlin.Middleware
|
||||
|
|
@ -54,13 +53,10 @@ class TokensMiddleware {
|
|||
val isTestcard = scanResponse?.card?.isTestCard ?: false
|
||||
|
||||
scope.launch {
|
||||
val currencies = async {
|
||||
currenciesRepository.getSupportedTokens(isTestcard)
|
||||
.filter(action.supportedBlockchains?.toSet())
|
||||
}
|
||||
val delay = async { delay(600) }
|
||||
delay.await()
|
||||
store.dispatchOnMain(TokensAction.LoadCurrencies.Success(currencies.await()))
|
||||
val currencies = currenciesRepository.getSupportedTokens(isTestcard)
|
||||
.filter(action.supportedBlockchains?.toSet())
|
||||
delay(600)
|
||||
store.dispatchOnMain(TokensAction.LoadCurrencies.Success(currencies))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -78,8 +74,8 @@ class TokensMiddleware {
|
|||
val blockchainsToRemove = currentBlockchains.filter { !action.addedBlockchains.contains(it) }
|
||||
|
||||
val tokensToAdd = action.addedTokens.filter { !currentTokens.contains(it) }
|
||||
val tokensToRemove = currentTokens.filter {
|
||||
token -> !action.addedTokens.any { it.token == token.token }
|
||||
val tokensToRemove = currentTokens.filter { token ->
|
||||
!action.addedTokens.any { it.token == token.token }
|
||||
}
|
||||
val derivationStyle = scanResponse.card.derivationStyle
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue