diff --git a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt index 673b9fdf4c..bd536ed456 100644 --- a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt +++ b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultNetworksRepository.kt @@ -53,7 +53,7 @@ internal class DefaultNetworksRepository( override suspend fun fetchNetworkPendingTransactions(userWalletId: UserWalletId, networks: Set) { withContext(dispatchers.io) { - fetchNetworksPendingTransactionsIfCacheExpired(userWalletId, networks, false) + fetchNetworksPendingTransactions(userWalletId, networks) } } @@ -82,16 +82,12 @@ internal class DefaultNetworksRepository( } } - private suspend fun fetchNetworksPendingTransactionsIfCacheExpired( - userWalletId: UserWalletId, - networks: Set, - refresh: Boolean, - ) { + private suspend fun fetchNetworksPendingTransactions(userWalletId: UserWalletId, networks: Set) { coroutineScope { networks .map { network -> async { - fetchNetworkPendingTransactionsIfCacheExpired(userWalletId, network, refresh) + fetchNetworkPendingTransactions(userWalletId, network) } } .awaitAll() @@ -110,20 +106,6 @@ internal class DefaultNetworksRepository( ) } - private suspend fun fetchNetworkPendingTransactionsIfCacheExpired( - userWalletId: UserWalletId, - network: Network, - refresh: Boolean, - ) { - val key = getNetworksStatusesCacheKey(userWalletId, network) - cacheRegistry.invalidate(key) - cacheRegistry.invokeOnExpire( - key = key, - skipCache = refresh, - block = { fetchNetworkPendingTransactions(userWalletId, network) }, - ) - } - private suspend fun fetchNetworkStatus(userWalletId: UserWalletId, network: Network) { val currencies = getCurrencies(userWalletId, network)