1
0

qml: don't show ln payment dialog, update info text instead

This commit is contained in:
Sander van Grieken
2023-03-29 18:25:29 +02:00
parent 57786049e9
commit 7efd6fe1e2
3 changed files with 26 additions and 8 deletions

View File

@@ -47,10 +47,11 @@ ElDialog {
columns: 2
InfoTextArea {
id: helpText
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.bottomMargin: constants.paddingLarge
visible: invoice.userinfo
visible: text
text: invoice.userinfo
iconStyle: InfoTextArea.IconStyle.Warn
}
@@ -457,14 +458,34 @@ ElDialog {
// save invoice if new or modified
invoice.save_invoice()
}
dialog.close()
doPay() // only signal here
helpText.text = qsTr('Payment in progress...')
}
}
}
}
Connections {
target: Daemon.currentWallet
function onPaymentSucceeded(key) {
if (key != invoice.key) {
console.log('wrong invoice ' + key + ' != ' + invoice.key)
return
}
console.log('payment succeeded!')
helpText.text = qsTr('Paid!')
}
function onPaymentFailed(key, reason) {
if (key != invoice.key) {
console.log('wrong invoice ' + key + ' != ' + invoice.key)
return
}
console.log('payment failed: ' + reason)
helpText.text = qsTr('Payment failed: ' + reason)
}
}
Component.onCompleted: {
if (invoice_key != '') {
invoice.initFromKey(invoice_key)