aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/add-token/util.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-05-23 03:53:59 +0800
committerGitHub <noreply@github.com>2018-05-23 03:53:59 +0800
commitb5bbfd32648a7deb0fd8b25c12825697e522adf6 (patch)
treedab36d56c4eaf230512b7430ddb3baf75356eab0 /ui/app/components/pages/add-token/util.js
parenta8e0d38cfbb1c01705b56288511c2a8ce392e25d (diff)
parent8245bf010e22dda3e00c044429e3f5b880691fcb (diff)
downloadtangerine-wallet-browser-b5bbfd32648a7deb0fd8b25c12825697e522adf6.tar.gz
tangerine-wallet-browser-b5bbfd32648a7deb0fd8b25c12825697e522adf6.tar.zst
tangerine-wallet-browser-b5bbfd32648a7deb0fd8b25c12825697e522adf6.zip
Merge pull request #4308 from MetaMask/i4232-addtoken
Update designs for Add Token screen
Diffstat (limited to 'ui/app/components/pages/add-token/util.js')
-rw-r--r--ui/app/components/pages/add-token/util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/components/pages/add-token/util.js b/ui/app/components/pages/add-token/util.js
new file mode 100644
index 000000000..579c56cc0
--- /dev/null
+++ b/ui/app/components/pages/add-token/util.js
@@ -0,0 +1,13 @@
+import R from 'ramda'
+
+export function checkExistingAddresses (address, tokenList = []) {
+ if (!address) {
+ return false
+ }
+
+ const matchesAddress = existingToken => {
+ return existingToken.address.toLowerCase() === address.toLowerCase()
+ }
+
+ return R.any(matchesAddress)(tokenList)
+}