fix: enter Lightning invoice amounts in sats (#3525)

LN receive remapped btcln to BTC, so the default "sats (LN)" display mode never applied and the amount field stayed in BTC.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Konstantin Ullrich <konstantin@cakewallet.com>
This commit is contained in:
Omid
2026-09-26 11:10:54 +03:00
committed by GitHub
co-authored by Cursor Konstantin Ullrich
parent 2d8d068418
commit fdb8267583
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -72,6 +72,7 @@ class _NewReceivePageState extends State<NewReceivePage> {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (widget.lightningMode) {
widget.addressListViewModel.setTokenCurrency(CryptoCurrency.btcln);
widget.receiveOptionViewModel.selectReceiveOption(
widget.receiveOptionViewModel.options
.firstWhereOrNull((item) => item.value.contains("Lightning")) ??
@@ -86,7 +86,12 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
);
void setTokenCurrency(Currency curr) {
if (curr == wallet.currency || curr == CryptoCurrency.btcln) {
if (curr == CryptoCurrency.btcln) {
tokenCurrency = null;
selectedCurrency = CryptoCurrency.btcln;
return;
}
if (curr == wallet.currency) {
tokenCurrency = null;
selectedCurrency = wallet.currency;
return;