Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-28 14:39:19 +04:00
parent 038cfc6d85
commit b5ea13145c

View file

@ -87,10 +87,7 @@ class ManageCryptoCurrenciesUseCase(
account = accountStatus.account.copy(cryptoCurrencies = modifiedCurrencyList.total.toSet()),
)
val isDerivingFailed = derivePublicKeys(
userWalletId = userWalletId,
currencies = modifiedCurrencyList.added,
).isLeft()
derivePublicKeys(userWalletId = userWalletId, currencies = modifiedCurrencyList.added)
parallelUpdatingScope.launch {
/*
@ -99,12 +96,12 @@ class ManageCryptoCurrenciesUseCase(
*/
val isOnlyRemoval = modifiedCurrencyList.added.isEmpty() && modifiedCurrencyList.removed.isNotEmpty()
if (isDerivingFailed || isOnlyRemoval) {
if (isOnlyRemoval) {
launch { accountsCRUDRepository.syncTokens(userWalletId) }
clearMetadata(userWalletId = userWalletId, currencies = modifiedCurrencyList.removed)
return@launch
}
if (isDerivingFailed) return@launch
cryptoCurrencyBalanceFetcher(userWalletId = userWalletId, currencies = modifiedCurrencyList.added)
refreshExpress(userWalletId = userWalletId, currencies = modifiedCurrencyList.total)
clearMetadata(userWalletId = userWalletId, currencies = modifiedCurrencyList.removed)