Update NIP90ContentDiscoveryScreen.kt
This commit is contained in:
+18
-8
@@ -278,7 +278,6 @@ fun FeedDVM(
|
|||||||
var lninvoice = ""
|
var lninvoice = ""
|
||||||
var amount: Long = 0
|
var amount: Long = 0
|
||||||
var statusNote: Note? = null
|
var statusNote: Note? = null
|
||||||
var dvmUser: User? = null
|
|
||||||
|
|
||||||
if (latestStatus == null) {
|
if (latestStatus == null) {
|
||||||
content = stringResource(R.string.dvm_waiting_status)
|
content = stringResource(R.string.dvm_waiting_status)
|
||||||
@@ -353,14 +352,25 @@ fun FeedDVM(
|
|||||||
if (status == "payment-required") {
|
if (status == "payment-required") {
|
||||||
if (lninvoice != "") {
|
if (lninvoice != "") {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
// TODO is there a better function?
|
|
||||||
Button(onClick = {
|
Button(onClick = {
|
||||||
payViaIntent(
|
if (accountViewModel.account.hasWalletConnectSetup()) {
|
||||||
lninvoice,
|
// ZapPaymentHandler.payViaNWC(lninvoice, statusNote ...)
|
||||||
context,
|
// TODO is there a way to use payViaNWC instead of this? It's suspended.
|
||||||
onPaid = { println("paid") },
|
|
||||||
onError = { println("error") },
|
payViaIntent(
|
||||||
)
|
lninvoice,
|
||||||
|
context,
|
||||||
|
onPaid = { println("paid") },
|
||||||
|
onError = { println("error") },
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
payViaIntent(
|
||||||
|
lninvoice,
|
||||||
|
context,
|
||||||
|
onPaid = { println("paid") },
|
||||||
|
onError = { println("error") },
|
||||||
|
)
|
||||||
|
}
|
||||||
}) {
|
}) {
|
||||||
Text(text = "Pay " + (amount / 1000).toString() + " Sats to the DVM")
|
Text(text = "Pay " + (amount / 1000).toString() + " Sats to the DVM")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user