aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/conversion-util.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-09-21 01:37:12 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-23 03:10:30 +0800
commit14bdc5a78c8529742754d69b8e45693b06b380fe (patch)
tree21d344592c90c2902fae5be9bf1603118c886ffe /ui/app/conversion-util.js
parent83cda2b82e082a5a9b2ee35a9b6d55be43b0d788 (diff)
downloadtangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar.gz
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar.bz2
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar.lz
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar.xz
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.tar.zst
tangerine-wallet-browser-14bdc5a78c8529742754d69b8e45693b06b380fe.zip
Client side error handling for from, to and amount fields in send.js
Diffstat (limited to 'ui/app/conversion-util.js')
-rw-r--r--ui/app/conversion-util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/conversion-util.js b/ui/app/conversion-util.js
index 0ede77487..7e02fe2bd 100644
--- a/ui/app/conversion-util.js
+++ b/ui/app/conversion-util.js
@@ -123,7 +123,20 @@ const addCurrencies = (a, b, { toNumericBase, numberOfDecimals }) => {
})
}
+const conversionGreaterThan = (
+ { value, fromNumericBase },
+ { value: compareToValue, fromNumericBase: compareToBase },
+) => {
+ const firstValue = converter({ value, fromNumericBase })
+ const secondValue = converter({
+ value: compareToValue,
+ fromNumericBase: compareToBase,
+ })
+ return firstValue.gt(secondValue)
+}
+
module.exports = {
conversionUtil,
addCurrencies,
+ conversionGreaterThan,
} \ No newline at end of file