Skip to content

Commit a895632

Browse files
Merge pull request #305 from SwissBitcoinPay/fix/bitcoinize-btc-amount
Fixed Bitcoinize BTC amount on auto-printing ticket
2 parents 6d6759a + cbc8a8f commit a895632

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_VERSION=2.5.20
2-
APP_BUILD_NUMBER=453
1+
APP_VERSION=2.5.21
2+
APP_BUILD_NUMBER=454
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Bitcoinize] Fixed wrong BTC amount on ticket auto-printing
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- [Bitcoinize] Corrigé le mauvais montant lors de l'impression automatique du ticket

src/screens/Invoice/Invoice.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,10 @@ export const Invoice = () => {
599599
// don't remove description if it already stored
600600
setDescription(getInvoiceData.description);
601601
}
602-
setAmount(getInvoiceData.amount * 1000);
602+
603+
const amountInSats = Math.round(getInvoiceData.amount * 1000);
604+
605+
setAmount(amountInSats);
603606
setPaidAt(getInvoiceData.paidAt);
604607
setInvoiceCurrency(getInvoiceData.input.unit || "CHF");
605608
setInvoiceFiatAmount(getInvoiceData.input.amount);
@@ -611,7 +614,7 @@ export const Invoice = () => {
611614
status !== "settled" &&
612615
!isExternalInvoice
613616
) {
614-
onFullScreenPaid(getInvoiceData);
617+
onFullScreenPaid({ ...getInvoiceData, amount: amountInSats });
615618
AsyncStorage.getItem(keyStoreTransactionsHistory).then(
616619
(transactionsHistory = "[]") => {
617620
let localTransactionsHistory: InvoiceType[] =

0 commit comments

Comments
 (0)