diff options
Diffstat (limited to 'ui/app/pages/add-token/util.js')
-rw-r--r-- | ui/app/pages/add-token/util.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/app/pages/add-token/util.js b/ui/app/pages/add-token/util.js new file mode 100644 index 000000000..579c56cc0 --- /dev/null +++ b/ui/app/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) +} |