qml: don't show ln payment dialog, update info text instead
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -312,13 +312,8 @@ Item {
|
||||
console.log('No invoice key, aborting')
|
||||
return
|
||||
}
|
||||
var dialog = lightningPaymentProgressDialog.createObject(mainView, {
|
||||
invoice_key: invoice.key
|
||||
})
|
||||
dialog.open()
|
||||
Daemon.currentWallet.pay_lightning_invoice(invoice.key)
|
||||
}
|
||||
close()
|
||||
}
|
||||
|
||||
onClosed: destroy()
|
||||
|
||||
@@ -347,8 +347,10 @@ class QEInvoiceParser(QEInvoice):
|
||||
|
||||
self.canSave = True
|
||||
|
||||
if amount.isEmpty: # unspecified amount
|
||||
if self.amount.isEmpty:
|
||||
self.userinfo = _('Enter the amount you want to send')
|
||||
|
||||
if amount.isEmpty and self.status == PR_UNPAID: # unspecified amount
|
||||
return
|
||||
|
||||
if self.invoiceType == QEInvoice.Type.LightningInvoice:
|
||||
|
||||
Reference in New Issue
Block a user