aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-11 02:05:10 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-11 02:05:10 +0800
commit7182a2be4332e7802c8d2375b9380490aed7ca0b (patch)
treef1f5fedd00106e6ebadf8766ba7534c59c784da0 /app/scripts/controllers
parentdc2d614da68ca851c3b1c0c108e7c2f22185751c (diff)
downloadtangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar.gz
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar.bz2
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar.lz
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar.xz
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.tar.zst
tangerine-wallet-browser-7182a2be4332e7802c8d2375b9380490aed7ca0b.zip
Improve duplicate checking in address book.
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/address-book.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/scripts/controllers/address-book.js b/app/scripts/controllers/address-book.js
index a75ef06ce..914fbded2 100644
--- a/app/scripts/controllers/address-book.js
+++ b/app/scripts/controllers/address-book.js
@@ -39,12 +39,12 @@ class AddressBookController {
// upper limit to the number of addresses.
_addToAddressBook (address, name) {
let addressBook = this._getAddressBook()
- let index = addressBook.findIndex((element) => { return element.address === address || element.name === name })
+ let index = addressBook.findIndex((element) => { return element.address.toLowerCase() === address.toLowerCase() || element.name === name })
if (index !== -1) {
addressBook.splice(index, 1)
}
addressBook.push({
- address,
+ address: address,
name,
})
return Promise.resolve(addressBook)