From 10671311203c4a1597204e438c4b4e783e082961 Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Sat, 29 Jun 2024 16:47:38 +0900 Subject: [PATCH] [btcpay] fix displayed amount --- .../bitcoin-invoice/bitcoin-invoice.component.html | 14 +++++++------- .../bitcoin-invoice/bitcoin-invoice.component.ts | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.html b/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.html index 1731a0e43..4e158e3e4 100644 --- a/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.html +++ b/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.html @@ -33,8 +33,8 @@
- - + +
@@ -45,7 +45,7 @@ @if (!minimal) { -

{{ invoice.amount }} BTC

+

{{ invoice.btcDue | number: '1.0-8' }} BTC

}
@@ -66,7 +66,7 @@ @if (!minimal) { -

{{ invoice.amount * 100_000_000 }} sats

+

{{ invoice.btcDue * 100_000_000 | number: '1.0-0' }} sats

} @@ -74,8 +74,8 @@
- - + +

@@ -86,7 +86,7 @@ @if (!minimal) { -

{{ invoice.amount }} BTC

+

{{ invoice.btcDue | number: '1.0-8' }} BTC

}
diff --git a/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.ts b/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.ts index 6f2d4b36c..395e1e41d 100644 --- a/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.ts +++ b/frontend/src/app/components/bitcoin-invoice/bitcoin-invoice.component.ts @@ -65,9 +65,7 @@ export class BitcoinInvoiceComponent implements OnInit, OnDestroy { this.paymentStatusSubscription = this.apiService.retreiveInvoice$(invoiceId).pipe( tap((invoice: any) => { this.invoice = invoice; - this.invoice.amount = invoice.btcDue ?? (invoice.cryptoInfo.length ? parseFloat(invoice.cryptoInfo[0].totalDue) : 0) ?? 0; - - if (this.invoice.amount > 0) { + if (this.invoice.btcDue > 0) { this.paymentStatus = 2; } else { this.paymentStatus = 4;