Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-10 13:59:53 +03:00
parent afcde269ce
commit 13ae7be53f
2 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,7 @@ import com.tangem.utils.converter.Converter
internal class CurrencyConverter : Converter<AppCurrency, AppCurrencySelectorState.Currency> {
override fun convert(value: AppCurrency): AppCurrencySelectorState.Currency {
val fullCurrencyName = with(value) { "$name ($code) - $symbol" }
val fullCurrencyName = with(value) { "$name ($code) $symbol" }
return AppCurrencySelectorState.Currency(value.code, fullCurrencyName)
}

View file

@ -34,7 +34,7 @@ internal class DefaultAppCurrencyRepository(
.collect(::send)
}
launch(dispatchers.io) {
withContext(dispatchers.io) {
if (selectedAppCurrencyStore.isEmpty()) {
fetchDefaultAppCurrency()
}
@ -47,6 +47,7 @@ internal class DefaultAppCurrencyRepository(
val currencies = availableAppCurrenciesStore.getAllSyncOrNull()
?.map(appCurrencyConverter::convert)
?.sortedBy(AppCurrency::name)
requireNotNull(currencies) {
"No available currencies stored"