Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-06 20:36:32 +05:00
parent aa36363c06
commit b74127df40
2 changed files with 3 additions and 4 deletions

View file

@ -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) }
}
}

View file

@ -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?
}