mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 23:56:43 +01:00
BugFix: Unparseable LN invoice
This commit is contained in:
@@ -30,7 +30,12 @@ import com.vitorpamplona.amethyst.R
|
||||
|
||||
@Composable
|
||||
fun InvoicePreview(lnInvoice: String) {
|
||||
val amount = LnInvoiceUtil.getAmountInSats(lnInvoice)
|
||||
val amount = try {
|
||||
LnInvoiceUtil.getAmountInSats(lnInvoice)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -70,6 +75,7 @@ fun InvoicePreview(lnInvoice: String) {
|
||||
|
||||
Divider()
|
||||
|
||||
amount?.let {
|
||||
Text(
|
||||
text = "${amount.toInt()} sats",
|
||||
fontSize = 25.sp,
|
||||
@@ -78,6 +84,7 @@ fun InvoicePreview(lnInvoice: String) {
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 10.dp),
|
||||
)
|
||||
}
|
||||
|
||||
Button(
|
||||
modifier = Modifier.fillMaxWidth().padding(vertical = 10.dp),
|
||||
|
||||
Reference in New Issue
Block a user