1
0

qml: move payment progress info text updates fully into qeinvoice, qeinvoice now updates itself

directly from backend wallet callbacks
This commit is contained in:
Sander van Grieken
2023-03-29 19:06:35 +02:00
parent 7efd6fe1e2
commit cc60ab0b20
2 changed files with 30 additions and 24 deletions

View File

@@ -53,7 +53,9 @@ ElDialog {
Layout.bottomMargin: constants.paddingLarge
visible: text
text: invoice.userinfo
iconStyle: InfoTextArea.IconStyle.Warn
iconStyle: invoice.status == Invoice.Failed || invoice.status == Invoice.Expired
? InfoTextArea.IconStyle.Warn
: InfoTextArea.IconStyle.Info
}
Label {
@@ -459,33 +461,12 @@ ElDialog {
invoice.save_invoice()
}
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)