Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit ca8d716

Browse files
committed
Display InvoiceQR view in fiat if selected
1 parent 20a9984 commit ca8d716

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/computed/invoice.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { computed, extendObservable } from 'mobx';
2-
import { formatNumber } from '../helper';
2+
import { toSatoshis, toAmountLabel } from '../helper';
33

44
const ComputedInvoice = store => {
55
extendObservable(store, {
6-
invoiceAmountLabel: computed(() => formatNumber(store.invoice.amount)),
6+
invoiceAmountLabel: computed(() => {
7+
const { invoice, settings } = store;
8+
const satoshis = toSatoshis(invoice.amount, settings.unit);
9+
return toAmountLabel(satoshis, store.settings);
10+
}),
711
});
812
};
913

src/view/invoice-qr.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ const InvoiceQRView = ({ store, nav, invoice }) => (
6666
<BalanceLabelNumeral style={styles.numeral}>
6767
{store.invoiceAmountLabel}
6868
</BalanceLabelNumeral>
69-
<BalanceLabelUnit style={styles.unit}>{store.unit}</BalanceLabelUnit>
69+
<BalanceLabelUnit style={styles.unit}>
70+
{store.unitLabel}
71+
</BalanceLabelUnit>
7072
</BalanceLabel>
7173
<NamedField name="Note">{store.invoice.note}</NamedField>
7274
<QRCode style={styles.qrcode}>{store.invoice.uri}</QRCode>

0 commit comments

Comments
 (0)