mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 20:46:42 +01:00
BugFix: Unparseable LN invoice
This commit is contained in:
@@ -30,7 +30,12 @@ import com.vitorpamplona.amethyst.R
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun InvoicePreview(lnInvoice: String) {
|
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
|
val context = LocalContext.current
|
||||||
|
|
||||||
@@ -70,14 +75,16 @@ fun InvoicePreview(lnInvoice: String) {
|
|||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
Text(
|
amount?.let {
|
||||||
text = "${amount.toInt()} sats",
|
Text(
|
||||||
fontSize = 25.sp,
|
text = "${amount.toInt()} sats",
|
||||||
fontWeight = FontWeight.W500,
|
fontSize = 25.sp,
|
||||||
modifier = Modifier
|
fontWeight = FontWeight.W500,
|
||||||
.fillMaxWidth()
|
modifier = Modifier
|
||||||
.padding(vertical = 10.dp),
|
.fillMaxWidth()
|
||||||
)
|
.padding(vertical = 10.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier.fillMaxWidth().padding(vertical = 10.dp),
|
modifier = Modifier.fillMaxWidth().padding(vertical = 10.dp),
|
||||||
|
|||||||
Reference in New Issue
Block a user