diff --git a/src/boot/base.js b/src/boot/base.js index 0391d287..bfb65c57 100644 --- a/src/boot/base.js +++ b/src/boot/base.js @@ -41,10 +41,12 @@ window.windowMixin = { currency = "sat"; } if (useUiStore().hideBalance && !showBalance) { - return "****" + return "****"; } if (currency == "sat") return this.formatSat(value); + if (currency == "msat") return this.fromMsat(value); if (currency == "usd") value = value / 100; + if (currency == "eur") value = value / 100; return new Intl.NumberFormat(window.LOCALE, { style: "currency", currency: currency, @@ -57,6 +59,10 @@ window.windowMixin = { value = parseInt(value); return new Intl.NumberFormat(window.LOCALE).format(value) + " sat"; }, + fromMsat: function (value) { + value = parseInt(value); + return new Intl.NumberFormat(window.LOCALE).format(value) + " msat"; + }, notifyApiError: function (error) { var types = { 400: "warning", diff --git a/src/components/InvoiceDetailDialog.vue b/src/components/InvoiceDetailDialog.vue index 21121f71..330e2504 100644 --- a/src/components/InvoiceDetailDialog.vue +++ b/src/components/InvoiceDetailDialog.vue @@ -37,7 +37,7 @@ flat color="primary" @click="toggleUnit()" - :label="activeUnit == 'sat' ? 'BTC' : 'USD'" + :label="activeUnitLabel" />
@@ -171,7 +171,7 @@ export default defineComponent({ }, computed: { ...mapState(useWalletStore, ["invoiceData"]), - ...mapState(useMintsStore, ["activeUnit"]), + ...mapState(useMintsStore, ["activeUnit", "activeUnitLabel"]), ...mapState(useWorkersStore, ["invoiceWorkerRunning"]), ...mapWritableState(useUiStore, ["showInvoiceDetails", "tickerShort"]), displayUnit: function () { diff --git a/src/components/SendTokenDialog.vue b/src/components/SendTokenDialog.vue index 99c111c8..a42148ac 100644 --- a/src/components/SendTokenDialog.vue +++ b/src/components/SendTokenDialog.vue @@ -64,7 +64,7 @@ flat color="primary" @click="toggleUnit()" - :label="activeUnit == 'sat' ? 'BTC' : 'USD'" + :label="activeUnitLabel" />