Skip to content

Commit

Permalink
Add ref + fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Sep 28, 2023
1 parent 2df9d87 commit 2382db1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scripts/WalletBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import { wallet, getNewAddress } from './wallet';
const balance = ref(0);
const price = ref(0.0);
const displayDecimals = ref(0);
const updating = ref(false);
const currency = ref('USD');
const balanceStr = computed(() => {
const nCoins = balance.value / COIN;
const strBal = nCoins.toFixed(nDisplayDecimals);
const strBal = nCoins.toFixed(displayDecimals.value);
const nLen = strBal.length;
return beautifyNumber(strBal, nLen >= 10 ? '17px' : '25px');
});
Expand Down Expand Up @@ -56,6 +57,7 @@ getEventEmitter().on('balance-update', async () => {
balance.value = mempool.getBalance();
currency.value = strCurrency.toUpperCase();
price.value = await cMarket.getPrice(strCurrency);
displayDecimals.value = nDisplayDecimals;
});
getEventEmitter().on('sync-status', (value) => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async function setDecimals(decimals) {
const database = await Database.getInstance();
database.setSettings({ displayDecimals: nDisplayDecimals });
// Update the UI to reflect the new decimals
getEventEmitter().emit('new-balance');
getEventEmitter().emit('balance-update');
getStakingBalance(true);
}

Expand Down

0 comments on commit 2382db1

Please sign in to comment.