aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 697417fd2..0e5a76d51 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -3,7 +3,7 @@ const Dnode = require('dnode')
const eos = require('end-of-stream')
const asyncQ = require('async-q')
const Migrator = require('./lib/migrator/')
-const migrations = require('./lib/migrations')
+const migrations = require('./lib/migrations/')
const LocalStorageStore = require('./lib/observable/local-storage')
const PortStream = require('./lib/port-stream.js')
const notification = require('./lib/notifications.js')
@@ -35,10 +35,7 @@ asyncQ.waterfall([
function loadStateFromPersistence() {
// migrations
let migrator = new Migrator({ migrations })
- let initialState = {
- meta: { version: migrator.defaultVersion },
- data: firstTimeState,
- }
+ let initialState = migrator.generateInitialState(firstTimeState)
return asyncQ.waterfall([
// read from disk
() => Promise.resolve(diskStore.get() || initialState),
@@ -68,6 +65,7 @@ function setupController (initState) {
// initial state
initState,
})
+ global.metamaskController = controller
// setup state persistence
controller.store.subscribe((newState) => diskStore)