Skip to content

Commit

Permalink
qml: lnurl override disabled amount edit color, show lnurlError to user
Browse files Browse the repository at this point in the history
  • Loading branch information
accumulator committed Mar 23, 2023
1 parent 8e7cbd6 commit 0d6828b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions electrum/gui/qml/components/LnurlPayRequestDialog.qml
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -100,4 +101,13 @@ ElDialog {
}
}
}

Connections {
target: invoiceParser
function onLnurlError(code, message) {
var dialog = app.messageDialog.createObject(app, { text: message })
dialog.open()
}
}

}
2 changes: 1 addition & 1 deletion electrum/gui/qml/qeinvoice.py
Expand Up @@ -558,7 +558,7 @@ def lnurlGetInvoice(self, amount, comment=None):
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:
Expand Down

0 comments on commit 0d6828b

Please sign in to comment.