diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-03-10 05:58:42 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-03-10 05:58:42 +0800 |
commit | 9f6c04055419f54a730bcbd3f1da4c5f992db94d (patch) | |
tree | 666d9433754e6e38c3b9550aee74bb28187a5fb0 /app/scripts/metamask-controller.js | |
parent | d270cbc9d2f45b6dae184efbe6c405889ee8cba5 (diff) | |
download | tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar.gz tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar.bz2 tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar.lz tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar.xz tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.tar.zst tangerine-wallet-browser-9f6c04055419f54a730bcbd3f1da4c5f992db94d.zip |
Create persistence address book.
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 536891dc6..6cdd8e96f 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -15,6 +15,7 @@ const PreferencesController = require('./controllers/preferences') const CurrencyController = require('./controllers/currency') const NoticeController = require('./notice-controller') const ShapeShiftController = require('./controllers/shapeshift') +const AddressBookController = require('./controllers/address-book') const MessageManager = require('./lib/message-manager') const PersonalMessageManager = require('./lib/personal-message-manager') const TxManager = require('./transaction-manager') @@ -50,6 +51,11 @@ module.exports = class MetamaskController extends EventEmitter { initState: initState.PreferencesController, }) + // address book controller + this.addressBookController = new AddressBookController({ + initState: initState.AddressBookController, + }) + // currency controller this.currencyController = new CurrencyController({ initState: initState.CurrencyController, @@ -124,6 +130,9 @@ module.exports = class MetamaskController extends EventEmitter { this.preferencesController.store.subscribe((state) => { this.store.updateState({ PreferencesController: state }) }) + this.addressBookController.store.subscribe((state) => { + this.store.updateState({ AddressBookController: state }) + }) this.currencyController.store.subscribe((state) => { this.store.updateState({ CurrencyController: state }) }) @@ -142,6 +151,7 @@ module.exports = class MetamaskController extends EventEmitter { this.personalMessageManager.memStore.subscribe(this.sendUpdate.bind(this)) this.keyringController.memStore.subscribe(this.sendUpdate.bind(this)) this.preferencesController.store.subscribe(this.sendUpdate.bind(this)) + this.addressBookController.store.subscribe(this.sendUpdate.bind(this)) this.currencyController.store.subscribe(this.sendUpdate.bind(this)) this.noticeController.memStore.subscribe(this.sendUpdate.bind(this)) this.shapeshiftController.store.subscribe(this.sendUpdate.bind(this)) @@ -219,6 +229,7 @@ module.exports = class MetamaskController extends EventEmitter { this.personalMessageManager.memStore.getState(), this.keyringController.memStore.getState(), this.preferencesController.store.getState(), + this.addressBookController.store.getState(), this.currencyController.store.getState(), this.noticeController.memStore.getState(), // config manager |