mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix first install flow
This commit is contained in:
parent
5baa4fd896
commit
16c24db13b
@ -1,5 +1,4 @@
|
||||
global.window = global
|
||||
const asyncQ = require('async-q')
|
||||
const pipe = require('pump')
|
||||
|
||||
const SwGlobalListener = require('sw-stream/lib/sw-global-listener.js')
|
||||
@ -39,18 +38,12 @@ console.log('inside:open')
|
||||
let diskStore
|
||||
const dbController = new DbController({
|
||||
key: STORAGE_KEY,
|
||||
global: self,
|
||||
version: 2,
|
||||
})
|
||||
asyncQ.waterfall([
|
||||
() => loadStateFromPersistence(),
|
||||
(initState) => setupController(initState),
|
||||
])
|
||||
loadStateFromPersistence()
|
||||
.then((initState) => setupController(initState))
|
||||
.then(() => console.log('MetaMask initialization complete.'))
|
||||
.catch((err) => {
|
||||
console.log('WHILE SETTING UP:')
|
||||
console.error(err)
|
||||
})
|
||||
.catch((err) => console.error('WHILE SETTING UP:', err))
|
||||
|
||||
// initialization flow
|
||||
|
||||
|
@ -38,7 +38,7 @@ module.exports = class IndexDbController extends EventEmitter {
|
||||
if (!data) {
|
||||
return this._add('dataStore', this.initialState)
|
||||
.then(() => this.get('dataStore'))
|
||||
.then((versionedData) => Promise.resolve(versionedData.data))
|
||||
.then((versionedData) => Promise.resolve(versionedData))
|
||||
}
|
||||
return Promise.resolve(data)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user