aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorBruno Barbieri <bruno.barbieri@consensys.net>2018-08-15 10:55:47 +0800
committerGitHub <noreply@github.com>2018-08-15 10:55:47 +0800
commit80fe3ce888ed361b45dca6c53521aa7b8124f95a (patch)
tree0169c01f1fce72654c39967296de0763be881525 /ui
parent82a5ed1e03e0a6a9bc19b946bc178b236d9aaa98 (diff)
parentd7aa1bf5c0ed4439526612cdf175db2d79e360cc (diff)
downloadtangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar.gz
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar.bz2
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar.lz
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar.xz
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.tar.zst
tangerine-wallet-browser-80fe3ce888ed361b45dca6c53521aa7b8124f95a.zip
Merge branch 'develop' into ledger-support
Diffstat (limited to 'ui')
-rw-r--r--ui/app/conversion-util.js4
-rw-r--r--ui/app/helpers/confirm-transaction/util.js2
-rw-r--r--ui/app/token-util.js2
-rw-r--r--ui/app/util.js4
4 files changed, 6 insertions, 6 deletions
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js
index a7a226cc5..38f5f1c50 100644
--- a/ui/app/conversion-util.js
+++ b/ui/app/conversion-util.js
@@ -46,7 +46,7 @@ const decToBigNumberViaString = n => R.pipe(String, toBigNumber['dec'])
// Setter Maps
const toBigNumber = {
hex: n => new BigNumber(stripHexPrefix(n), 16),
- dec: n => new BigNumber(n, 10),
+ dec: n => new BigNumber(String(n), 10),
BN: n => new BigNumber(n.toString(16), 16),
}
const toNormalizedDenomination = {
@@ -154,7 +154,7 @@ const subtractCurrencies = (a, b, options = {}) => {
bBase,
...conversionOptions
} = options
- const value = (new BigNumber(a, aBase)).minus(b, bBase)
+ const value = (new BigNumber(String(a), aBase)).minus(b, bBase)
return converter({
value,
diff --git a/ui/app/helpers/confirm-transaction/util.js b/ui/app/helpers/confirm-transaction/util.js
index a37778c19..76e80a8ac 100644
--- a/ui/app/helpers/confirm-transaction/util.js
+++ b/ui/app/helpers/confirm-transaction/util.js
@@ -141,7 +141,7 @@ export function hasUnconfirmedTransactions (state) {
export function roundExponential (value) {
const PRECISION = 4
- const bigNumberValue = new BigNumber(value)
+ const bigNumberValue = new BigNumber(String(value))
// In JS, numbers with exponentials greater than 20 get displayed as an exponential.
return bigNumberValue.e > 20 ? Number(bigNumberValue.toPrecision(PRECISION)) : value
diff --git a/ui/app/token-util.js b/ui/app/token-util.js
index 0d4233766..8798ed266 100644
--- a/ui/app/token-util.js
+++ b/ui/app/token-util.js
@@ -44,7 +44,7 @@ async function getSymbolAndDecimals (tokenAddress, existingTokens = []) {
function calcTokenAmount (value, decimals) {
const multiplier = Math.pow(10, Number(decimals || 0))
- return new BigNumber(value).div(multiplier).toNumber()
+ return new BigNumber(String(value)).div(multiplier).toNumber()
}
diff --git a/ui/app/util.js b/ui/app/util.js
index 8b194e0c7..ade4fec8a 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -271,9 +271,9 @@ function getContractAtAddress (tokenAddress) {
return global.eth.contract(abi).at(tokenAddress)
}
-function exportAsFile (filename, data) {
+function exportAsFile (filename, data, type = 'text/csv') {
// source: https://stackoverflow.com/a/33542499 by Ludovic Feltz
- const blob = new Blob([data], {type: 'text/csv'})
+ const blob = new Blob([data], {type})
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, filename)
} else {