Updated on 2026-08-14
This commit is contained in:
parent
aa36363c06
commit
b74127df40
2 changed files with 3 additions and 4 deletions
|
|
@ -68,11 +68,10 @@ internal class DefaultQuotesRepository(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun getQuoteSync(currencyId: CryptoCurrency.ID): Quote {
|
||||
override suspend fun getQuoteSync(currencyId: CryptoCurrency.ID): Quote? {
|
||||
return withContext(dispatchers.io) {
|
||||
val quote = quotesStore.getSync(setOf(currencyId)).firstOrNull()
|
||||
requireNotNull(quote) { "Unable to get quote for $currencyId" }
|
||||
quotesConverter.convert(quote)
|
||||
quote?.let { quotesConverter.convert(it) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,5 +30,5 @@ interface QuotesRepository {
|
|||
*/
|
||||
suspend fun getQuotesSync(currenciesIds: Set<CryptoCurrency.ID>, refresh: Boolean): Set<Quote>
|
||||
|
||||
suspend fun getQuoteSync(currencyId: CryptoCurrency.ID): Quote
|
||||
suspend fun getQuoteSync(currencyId: CryptoCurrency.ID): Quote?
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue