diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-14 07:37:53 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-03-14 07:37:53 +0800 |
commit | 4933e2e2eefa103d6b0d3f3ce264aaf661b50291 (patch) | |
tree | 2bb922e5e8a453859c3f71971be0c36e4695cfa6 /app | |
parent | d85cc7ec4ef4e93d424ef4debbca1bb27b952a4e (diff) | |
download | tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar.gz tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar.bz2 tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar.lz tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar.xz tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.tar.zst tangerine-wallet-browser-4933e2e2eefa103d6b0d3f3ce264aaf661b50291.zip |
Limit the number of addresses stored in our book.
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/controllers/address-book.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/scripts/controllers/address-book.js b/app/scripts/controllers/address-book.js index 0e97cc477..c66eb2bd4 100644 --- a/app/scripts/controllers/address-book.js +++ b/app/scripts/controllers/address-book.js @@ -50,7 +50,11 @@ class AddressBookController { // trigger this condition if we've seen this address before--may need to update nickname. } else if (addressBookIndex !== -1) { addressBook.splice(addressBookIndex, 1) + } else if (addressBook.length > 15) { + addressBook.shift() } + + addressBook.push({ address: address, name, |