Updated on 2026-08-14
This commit is contained in:
parent
b946eb5435
commit
029ba6e96c
5 changed files with 10 additions and 24 deletions
|
|
@ -100,14 +100,16 @@ internal class DefaultOnrampRepository(
|
|||
return countriesStore.getSyncOrNull(COUNTRIES_KEY)
|
||||
}
|
||||
|
||||
override suspend fun fetchCountries() = withContext(dispatchers.io) {
|
||||
if (!countriesStore.getSyncOrNull(COUNTRIES_KEY).isNullOrEmpty()) return@withContext
|
||||
override suspend fun fetchCountries(): List<OnrampCountry> = withContext(dispatchers.io) {
|
||||
if (!countriesStore.getSyncOrNull(COUNTRIES_KEY).isNullOrEmpty()) return@withContext emptyList()
|
||||
|
||||
val result = onrampApi.getCountries()
|
||||
.getOrThrow()
|
||||
.map(countryConverter::convert)
|
||||
|
||||
countriesStore.store(COUNTRIES_KEY, result)
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
override suspend fun getCountryByIp(): OnrampCountry = withContext(dispatchers.io) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue