qml: move payment progress info text updates fully into qeinvoice, qeinvoice now updates itself
directly from backend wallet callbacks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user