qml: fix lnurl-pay when config.BTC_AMOUNTS_ADD_THOUSANDS_SEP is True
when paying an lnurl-pay that provides an amount interval, the amount field is editable by the user and it expects no spaces
This commit is contained in:
@@ -64,7 +64,7 @@ ElDialog {
|
||||
BtcField {
|
||||
id: amountBtc
|
||||
Layout.preferredWidth: rootLayout.width /3
|
||||
text: Config.formatSats(invoiceParser.lnurlData['min_sendable_sat'])
|
||||
text: Config.formatSatsForEditing(invoiceParser.lnurlData['min_sendable_sat'])
|
||||
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||
color: Material.foreground // override gray-out on disabled
|
||||
fiatfield: amountFiat
|
||||
|
||||
@@ -211,6 +211,15 @@ class QEConfig(AuthMixin, QObject):
|
||||
self.config.GUI_QML_USER_KNOWS_PRESS_AND_HOLD = userKnowsPressAndHold
|
||||
self.userKnowsPressAndHoldChanged.emit()
|
||||
|
||||
@pyqtSlot('qint64', result=str)
|
||||
@pyqtSlot(QEAmount, result=str)
|
||||
def formatSatsForEditing(self, satoshis):
|
||||
if isinstance(satoshis, QEAmount):
|
||||
satoshis = satoshis.satsInt
|
||||
return self.config.format_amount(
|
||||
satoshis,
|
||||
add_thousands_sep=False,
|
||||
)
|
||||
|
||||
@pyqtSlot('qint64', result=str)
|
||||
@pyqtSlot('qint64', bool, result=str)
|
||||
|
||||
Reference in New Issue
Block a user