qml: lnurl override disabled amount edit color, show lnurlError to user
This commit is contained in:
@@ -55,10 +55,11 @@ ElDialog {
|
||||
BtcField {
|
||||
id: amountBtc
|
||||
text: Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])
|
||||
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||
color: Material.foreground // override gray-out on disabled
|
||||
fiatfield: null
|
||||
Layout.preferredWidth: parent.width /3
|
||||
onTextAsSatsChanged: {
|
||||
onTextAsSatsChanged: {
|
||||
invoiceParser.amountOverride = textAsSats
|
||||
}
|
||||
}
|
||||
@@ -100,4 +101,13 @@ ElDialog {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: invoiceParser
|
||||
function onLnurlError(code, message) {
|
||||
var dialog = app.messageDialog.createObject(app, { text: message })
|
||||
dialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ class QEInvoiceParser(QEInvoice):
|
||||
assert amount >= self.lnurlData['min_sendable_sat']
|
||||
assert amount <= self.lnurlData['max_sendable_sat']
|
||||
except:
|
||||
self.lnurlError.emit('lnurl', _('Amount out of bounds'))
|
||||
self.lnurlError.emit('amount', _('Amount out of bounds'))
|
||||
return
|
||||
|
||||
if self._lnurlData['comment_allowed'] == 0:
|
||||
|
||||
Reference in New Issue
Block a user