Updated on 2026-08-14
This commit is contained in:
parent
7fdf9167ea
commit
5a277755c4
4 changed files with 12 additions and 2 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit ade38b689e5e390cf4105f9dfa641b4f6912dcd0
|
||||
Subproject commit f5a90466d2245ca5cfde59b49dc7fa82a6b7cbc2
|
||||
|
|
@ -30,6 +30,14 @@ internal class DefaultQuotesStore(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote> {
|
||||
return currenciesIds.mapNotNull { currencyId ->
|
||||
currencyId.rawCurrencyId?.let {
|
||||
dataStore.getSyncOrNull(it)
|
||||
}
|
||||
}.toSet()
|
||||
}
|
||||
|
||||
override suspend fun store(response: QuotesResponse) {
|
||||
val quotes = response.quotes.mapValues { (id, quote) ->
|
||||
StoredQuote(id, quote)
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ interface QuotesStore {
|
|||
|
||||
fun get(currenciesIds: Set<CryptoCurrency.ID>): Flow<Set<StoredQuote>>
|
||||
|
||||
suspend fun getSync(currenciesIds: Set<CryptoCurrency.ID>): Set<StoredQuote>
|
||||
|
||||
suspend fun store(response: QuotesResponse)
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ internal class DefaultQuotesRepository(
|
|||
|
||||
fetchExpiredQuotes(currenciesIds, selectedAppCurrency.id, refresh)
|
||||
|
||||
val quotes = quotesStore.get(currenciesIds).first()
|
||||
val quotes = quotesStore.getSync(currenciesIds)
|
||||
|
||||
quotesConverter.convertSet(quotes)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue