aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-06-20 10:03:49 +0800
committerDan Finlay <dan@danfinlay.com>2017-06-20 10:03:49 +0800
commit41d992cca960c9f1b17bbd4bac9793902a7d1716 (patch)
treee64fd9de39ab614b73425bdc911d67122b99c2b8 /app/scripts/metamask-controller.js
parent48789f2a3df2c820b61902fb49057f9f7b6cbd8c (diff)
parent0799e5edf5b508f588af93431db0df3bd7e6c27d (diff)
downloadtangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar.gz
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar.bz2
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar.lz
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar.xz
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.tar.zst
tangerine-wallet-browser-41d992cca960c9f1b17bbd4bac9793902a7d1716.zip
Merge branch 'AddTokenList' into i1616-AddTokenAdding
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index e4267381d..39d22f278 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -23,6 +23,7 @@ const autoFaucet = require('./lib/auto-faucet')
const nodeify = require('./lib/nodeify')
const accountImporter = require('./account-import-strategies')
const getBuyEthUrl = require('./lib/buy-eth-url')
+const debounce = require('debounce')
const version = require('../manifest.json').version
@@ -30,6 +31,9 @@ module.exports = class MetamaskController extends EventEmitter {
constructor (opts) {
super()
+
+ this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200)
+
this.opts = opts
const initState = opts.initState || {}
@@ -98,6 +102,7 @@ module.exports = class MetamaskController extends EventEmitter {
provider: this.provider,
blockTracker: this.provider,
ethQuery: this.ethQuery,
+ ethStore: this.ethStore,
})
// notices
@@ -356,7 +361,7 @@ module.exports = class MetamaskController extends EventEmitter {
)
}
- sendUpdate () {
+ privateSendUpdate () {
this.emit('update', this.getState())
}