Updated on 2026-08-14
This commit is contained in:
parent
7cb4b57fe9
commit
cf79b3b9a8
6 changed files with 49 additions and 14 deletions
|
|
@ -163,6 +163,7 @@ internal class DefaultManageTokensRepository(
|
|||
)
|
||||
}
|
||||
|
||||
@Suppress("CyclomaticComplexMethod")
|
||||
private suspend fun createManagedCryptoCurrencyList(
|
||||
params: ManageTokensListConfig.Account,
|
||||
userWallet: UserWallet?,
|
||||
|
|
@ -172,11 +173,15 @@ internal class DefaultManageTokensRepository(
|
|||
updatedCoinsResponse: CoinsResponse,
|
||||
): List<ManagedCryptoCurrency> {
|
||||
val response = params.userWalletId?.let { userWalletId ->
|
||||
if (loadUserTokensFromRemote && userWallet != null) {
|
||||
val shouldFetch = loadUserTokensFromRemote && userWallet != null
|
||||
|
||||
val fetchedResponse = if (shouldFetch) {
|
||||
runCatching { walletAccountsFetcher.fetch(userWalletId = userWallet.walletId) }.getOrNull()
|
||||
} else {
|
||||
walletAccountsFetcher.getSaved(userWalletId)
|
||||
null
|
||||
}
|
||||
|
||||
fetchedResponse ?: walletAccountsFetcher.getSaved(userWalletId)
|
||||
}
|
||||
|
||||
val accountId = when {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue