Updated on 2026-08-14
This commit is contained in:
commit
6a0d382af6
2 changed files with 13 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue