From b5ea13145c337d3f0a62bbe54d0f35d087d61843 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 28 Nov 2025 14:39:19 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../status/usecase/ManageCryptoCurrenciesUseCase.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/domain/account/status/src/main/java/com/tangem/domain/account/status/usecase/ManageCryptoCurrenciesUseCase.kt b/domain/account/status/src/main/java/com/tangem/domain/account/status/usecase/ManageCryptoCurrenciesUseCase.kt index 9277ab4837..9e4e862dda 100644 --- a/domain/account/status/src/main/java/com/tangem/domain/account/status/usecase/ManageCryptoCurrenciesUseCase.kt +++ b/domain/account/status/src/main/java/com/tangem/domain/account/status/usecase/ManageCryptoCurrenciesUseCase.kt @@ -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)