Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-10 16:22:03 +03:00
commit 6a0d382af6
2 changed files with 13 additions and 4 deletions

View file

@ -46,9 +46,16 @@ internal class DefaultQuotesStore(
}
override suspend fun getSync(currenciesIds: Set<CryptoCurrency.RawID>): Set<Quote> {
return runtimeStore.getSyncOrDefault(default = emptySet())
.filter { it.rawCurrencyId in currenciesIds }
.toSet()
val runtimeQuotes = runtimeStore.getSyncOrNull()
val cachedQuotes = getCachedQuotes(currenciesIds = currenciesIds)
if (runtimeQuotes.isNullOrEmpty() && cachedQuotes.isEmpty()) return emptySet()
return mergeQuotes(
currenciesIds = currenciesIds,
cachedQuotes = cachedQuotes,
runtimeQuotes = runtimeQuotes.orEmpty(),
)
}
override suspend fun store(response: QuotesResponse) {

View file

@ -83,7 +83,9 @@ internal class CustomTokensMerger(
return token.copy(
id = foundToken.id,
name = foundToken.name,
symbol = foundToken.symbol,
symbol = foundToken.symbol.ifEmpty {
token.symbol
},
)
}