Updated on 2026-08-14
This commit is contained in:
parent
e56e411930
commit
5352f6e6f4
7 changed files with 1186 additions and 1 deletions
|
|
@ -169,6 +169,26 @@ internal class DefaultWalletAmountsRepository(
|
|||
.fold()
|
||||
}
|
||||
|
||||
private suspend fun fetchAmountsForUserWallet(
|
||||
userWallet: UserWallet,
|
||||
): CompletionResult<Unit> = withContext(Dispatchers.Default) {
|
||||
val walletId = userWallet.walletId
|
||||
val scanResponse = userWallet.scanResponse
|
||||
val walletStores = walletStoresStorage.getAll()
|
||||
.first()
|
||||
.getOrElse(walletId) { emptyList() }
|
||||
|
||||
walletStores.map { walletStore ->
|
||||
async {
|
||||
// TODO: Find wallet manager via [com.tangem.tap.domain.walletStores.repository.WalletManagersRepository]
|
||||
val walletManager = walletStore.walletManager
|
||||
fetchAmountsForWalletStore(walletId, scanResponse, walletStore, walletManager)
|
||||
}
|
||||
}
|
||||
.awaitAll()
|
||||
.fold()
|
||||
}
|
||||
|
||||
private suspend fun fetchAmountsForWalletStore(
|
||||
walletId: UserWalletId,
|
||||
scanResponse: ScanResponse,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class MultiWalletReducer {
|
|||
val selectedCurrency = if (!state.isMultiwalletAllowed) {
|
||||
walletStores.firstOrNull()?.walletsData?.firstOrNull()?.currency
|
||||
} else {
|
||||
state.selectedCurrency
|
||||
state.selectedWalletData?.currency
|
||||
}
|
||||
state.copy(
|
||||
walletsStores = walletStores,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue