Skip to content

Commit fcfd2f6

Browse files
committed
fix: stale currencies
1 parent cd7f0b7 commit fcfd2f6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAdvancedScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ fun SpendingAdvancedScreen(
7575

7676
val transferValues by viewModel.transferValues.collectAsStateWithLifecycle()
7777
val currentMaxLspBalance by rememberUpdatedState(transferValues.maxLspBalance)
78+
val currentCurrencies by rememberUpdatedState(currencies)
7879

7980
LaunchedEffect(order.clientBalanceSat) {
8081
viewModel.updateTransferValues(order.clientBalanceSat)
@@ -113,7 +114,7 @@ fun SpendingAdvancedScreen(
113114
amountInputViewModel.effect.collect {
114115
when (it) {
115116
AmountInputEffect.MaxExceeded -> {
116-
amountInputViewModel.setSats(currentMaxLspBalance.toLong(), currencies)
117+
amountInputViewModel.setSats(currentMaxLspBalance.toLong(), currentCurrencies)
117118
app.toast(
118119
type = Toast.ToastType.WARNING,
119120
title = context.getString(R.string.lightning__spending_advanced__error_max__title),

app/src/main/java/to/bitkit/ui/screens/transfer/SpendingAmountScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ fun SpendingAmountScreen(
7373
val amountUiState by amountInputViewModel.uiState.collectAsStateWithLifecycle()
7474
val context = LocalContext.current
7575
val currentMaxAllowedToSend by rememberUpdatedState(uiState.maxAllowedToSend)
76+
val currentCurrencies by rememberUpdatedState(currencies)
7677

7778
LaunchedEffect(isOffline) {
7879
viewModel.updateLimits()
@@ -92,7 +93,7 @@ fun SpendingAmountScreen(
9293
amountInputViewModel.effect.collect {
9394
when (it) {
9495
AmountInputEffect.MaxExceeded -> {
95-
amountInputViewModel.setSats(currentMaxAllowedToSend, currencies)
96+
amountInputViewModel.setSats(currentMaxAllowedToSend, currentCurrencies)
9697
toast(
9798
context.getString(R.string.lightning__spending_amount__error_max__title),
9899
context.getString(R.string.lightning__spending_amount__error_max__description)

0 commit comments

Comments
 (0)