Skip to content

Commit

Permalink
Define currency if no fiat is set
Browse files Browse the repository at this point in the history
  • Loading branch information
n9lsjr committed Oct 16, 2024
1 parent 76f376f commit af4ff18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/electron.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ function createWindow() {
windowState.saveState(mainWindow);
});


if (dev) {
console.log('Running in development')
mainWindow.openDevTools()
}

return mainWindow;
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib/components/Balance.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
function changeTicker(it) {
let change = true;
let currency = $fiat.currencies.find((a) => a.ticker === it);
if (!currency) currency = $fiat.currencies.find((a) => a.ticker === 'usd');
if (currency.symbolLocation === 'postfix') change = false;
return [currency.symbol, change];
}
$: {
if (showFiat) {
fiatBalance = (($wallet.balance[0] * $fiat.balance) / 100000).toFixed(5);
if (fiatBalance == 'NaN') fiatBalance = 0;
let [ticker, change] = changeTicker($fiat.ticker);
if (change) display = ticker + fiatBalance;
else display = fiatBalance + '///' + ticker.toUpperCase();
Expand Down

0 comments on commit af4ff18

Please sign in to comment.