Updated on 2026-08-14
This commit is contained in:
parent
b1fd4510f4
commit
ac3ea5b531
1 changed files with 10 additions and 3 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue