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 {
|
BtcField {
|
||||||
id: amountBtc
|
id: amountBtc
|
||||||
Layout.preferredWidth: rootLayout.width /3
|
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']
|
enabled: invoiceParser.lnurlData['min_sendable_sat'] != invoiceParser.lnurlData['max_sendable_sat']
|
||||||
color: Material.foreground // override gray-out on disabled
|
color: Material.foreground // override gray-out on disabled
|
||||||
fiatfield: amountFiat
|
fiatfield: amountFiat
|
||||||
|
|||||||
@@ -223,6 +223,15 @@ class QEConfig(AuthMixin, QObject):
|
|||||||
self.config.set_key('user_knows_press_and_hold', userKnowsPressAndHold)
|
self.config.set_key('user_knows_press_and_hold', userKnowsPressAndHold)
|
||||||
self.userKnowsPressAndHoldChanged.emit()
|
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', result=str)
|
||||||
@pyqtSlot('qint64', bool, result=str)
|
@pyqtSlot('qint64', bool, result=str)
|
||||||
|
|||||||
Reference in New Issue
Block a user