@@ -544,12 +544,13 @@ class AppViewModel @Inject constructor(
544544 payMethod = lnInvoice?.let { SendMethod .LIGHTNING } ? : SendMethod .ONCHAIN ,
545545 )
546546 }
547- val isLnInvoiceWithAmount = lnInvoice?.amountSatoshis?.takeIf { it > 0uL } != null
548- if (isLnInvoiceWithAmount) {
547+
548+ val lnAmountSats = lnInvoice?.amountSatoshis ? : 0u
549+ if (lnAmountSats > 0u ) {
549550 Logger .info(" Found amount in unified invoice, checking QuickPay conditions" , context = TAG )
550551
551552 val quickPayHandled = handleQuickPayIfApplicable(
552- amountSats = lnInvoice.amountSatoshis ,
553+ amountSats = lnAmountSats ,
553554 invoice = lnInvoice,
554555 )
555556 if (quickPayHandled) return
@@ -562,8 +563,14 @@ class AppViewModel @Inject constructor(
562563 }
563564 return
564565 }
565- Logger .info(" No amount found in invoice, proceeding to enter amount manually" , context = TAG )
566- resetAmountInput()
566+
567+ Logger .info(
568+ when (invoice.amountSatoshis > 0u ) {
569+ true -> " Found amount in invoice, proceeding to edit amount"
570+ else -> " No amount found in invoice, proceeding to enter amount"
571+ },
572+ context = TAG ,
573+ )
567574
568575 if (isMainScanner) {
569576 showSheet(Sheet .Send (SendRoute .Amount ))
@@ -614,8 +621,7 @@ class AppViewModel @Inject constructor(
614621 }
615622 return
616623 }
617- Logger .info(" No amount found in invoice, proceeding to enter amount manually" , context = TAG )
618- resetAmountInput()
624+ Logger .info(" No amount found in invoice, proceeding to enter amount" , context = TAG )
619625
620626 if (isMainScanner) {
621627 showSheet(Sheet .Send (SendRoute .Amount ))
0 commit comments