Browse Source

Fix #115 and related tweaks

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
076ccfc96d
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 3
      app/utils.js
  2. 3
      views/includes/value-display.pug
  3. 2
      views/layout.pug

3
app/utils.js

@ -167,6 +167,9 @@ function formatCurrencyAmountWithForcedDecimalPlaces(amount, formatType, forcedD
dec = dec.times(global.exchangeRates[formatInfo.multiplier]);
return addThousandsSeparators(dec.toDecimalPlaces(decimalPlaces)) + " " + formatInfo.name;
} else {
return formatCurrencyAmountWithForcedDecimalPlaces(amount, coinConfig.defaultCurrencyUnit.name, forcedDecimalPlaces);
}
}
}

3
views/includes/value-display.pug

@ -7,6 +7,9 @@ if (currencyValue > 0)
if (currencyFormatInfo.type == "native")
if (global.exchangeRates)
small.border-dotted.ml-1(data-toggle="tooltip", title=utils.formatExchangedCurrency(currencyValue, "usd")) #{parts[1]}
else
small.ml-1 #{parts[1]}
else if (currencyFormatInfo.type == "exchanged")
small.border-dotted.ml-1(data-toggle="tooltip", title=utils.formatCurrencyAmount(currencyValue, coinConfig.defaultCurrencyUnit.name)) #{parts[1]}

2
views/layout.pug

@ -83,7 +83,7 @@ html(lang="en")
if (coinConfig.currencyUnits)
span(class="dropdown-header") Currency Units
each item in coinConfig.currencyUnits
if (item.type == "native" || config.queryExchangeRates)
if (item.type == "native" || (config.queryExchangeRates && !config.privacyMode))
a(class="dropdown-item", href=("/changeSetting?name=currencyFormatType&value=" + item.values[0]))
each valueName in item.values
if (currencyFormatType == valueName)

Loading…
Cancel
Save