aboutsummaryrefslogtreecommitdiffstats
path: root/ui/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/index.js')
-rw-r--r--ui/index.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/index.js b/ui/index.js
index ac860e0db..db9292761 100644
--- a/ui/index.js
+++ b/ui/index.js
@@ -12,19 +12,19 @@ module.exports = launchMetamaskUi
log.setLevel(global.METAMASK_DEBUG ? 'debug' : 'warn')
function launchMetamaskUi (opts, cb) {
- var accountManager = opts.accountManager
- actions._setBackgroundConnection(accountManager)
+ var {backgroundConnection} = opts
+ actions._setBackgroundConnection(backgroundConnection)
// check if we are unlocked first
- accountManager.getState(function (err, metamaskState) {
+ backgroundConnection.getState(function (err, metamaskState) {
if (err) return cb(err)
- startApp(metamaskState, accountManager, opts)
+ startApp(metamaskState, backgroundConnection, opts)
.then((store) => {
cb(null, store)
})
})
}
-async function startApp (metamaskState, accountManager, opts) {
+async function startApp (metamaskState, backgroundConnection, opts) {
// parse opts
if (!metamaskState.featureFlags) metamaskState.featureFlags = {}
@@ -34,6 +34,7 @@ async function startApp (metamaskState, accountManager, opts) {
const enLocaleMessages = await fetchLocale('en')
const store = configureStore({
+ activeTab: opts.activeTab,
// metamaskState represents the cross-tab state
metamask: metamaskState,
@@ -59,7 +60,7 @@ async function startApp (metamaskState, accountManager, opts) {
}))
}
- accountManager.on('update', function (metamaskState) {
+ backgroundConnection.on('update', function (metamaskState) {
store.dispatch(actions.updateMetamaskState(metamaskState))
})
@@ -79,7 +80,7 @@ async function startApp (metamaskState, accountManager, opts) {
// inject initial state
store: store,
}
- ), opts.container)
+ ), opts.container)
return store
}