From 019ac7ae317e3ec503c9f01df2f7ffcdcd5021f1 Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 12 Sep 2023 06:48:01 +0200 Subject: [PATCH] Checkout: Cheating improvements (#5315) Minor updates to the cheating options: - Some browsers do not submit disabled fields, hence I made the amount field readonly in case of Lightning. - Convert remaining amount when switching from onchain BTC to Lightning sats. --- BTCPayServer/Views/UIInvoice/Checkout-Cheating.cshtml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/Views/UIInvoice/Checkout-Cheating.cshtml b/BTCPayServer/Views/UIInvoice/Checkout-Cheating.cshtml index 3b1482f2c..3e66a894a 100644 --- a/BTCPayServer/Views/UIInvoice/Checkout-Cheating.cshtml +++ b/BTCPayServer/Views/UIInvoice/Checkout-Cheating.cshtml @@ -13,7 +13,7 @@
- +
@@ -78,6 +78,12 @@ }, isSats () { return this.cryptoCode === 'sats'; + }, + amount () { + const amount = this.isSats && this.amountRemaining < 1 + ? this.amountRemaining * 100000000 + : this.amountRemaining; + return amount < 0 ? 0 : amount; } }, methods: {