Skip to content

Commit a85dfc9

Browse files
committed
refactor: replace getCurrencySymbol with get from local state
1 parent 2edd1a4 commit a85dfc9

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

app/src/main/java/to/bitkit/repositories/CurrencyRepo.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ class CurrencyRepo @Inject constructor(
177177
refresh()
178178
}
179179

180-
fun getCurrencySymbol(): String {
181-
return _currencyState.value.currencySymbol
182-
}
183-
184180
fun getCurrentRate(currency: String): FxRate? {
185181
return _currencyState.value.rates.firstOrNull { it.quote == currency }
186182
}

app/src/main/java/to/bitkit/ui/ContentView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ private fun NavGraphBuilder.widgets(
10691069
WidgetType.WEATHER -> navController.navigate(Routes.WeatherPreview)
10701070
}
10711071
},
1072-
fiatSymbol = currencyViewModel.getCurrencySymbol()
1072+
fiatSymbol = LocalCurrencies.current.currencySymbol,
10731073
)
10741074
}
10751075
composableWithDefaultTransitions<Routes.CalculatorPreview> {

app/src/main/java/to/bitkit/viewmodels/CurrencyViewModel.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class CurrencyViewModel @Inject constructor(
4949
}
5050
}
5151

52-
fun getCurrencySymbol(): String = currencyRepo.getCurrencySymbol()
53-
5452
// UI Helpers
5553
fun convert(sats: Long, currency: String? = null): ConvertedAmount? {
5654
return currencyRepo.convertSatsToFiat(sats, currency).getOrNull()

0 commit comments

Comments
 (0)