2017-01-12 04:26:56 +01:00
|
|
|
const ConfigManager = require('../../app/scripts/lib/config-manager')
|
2017-01-12 07:47:56 +01:00
|
|
|
const LocalStorageStore = require('../../app/scripts/lib/observable/local-storage')
|
|
|
|
const firstTimeState = require('../../app/scripts/first-time-state')
|
2016-10-29 11:29:25 +02:00
|
|
|
const STORAGE_KEY = 'metamask-config'
|
2016-06-25 01:13:27 +02:00
|
|
|
|
|
|
|
module.exports = function() {
|
2017-01-12 07:47:56 +01:00
|
|
|
let dataStore = new LocalStorageStore({ storageKey: STORAGE_KEY })
|
|
|
|
// initial state for first time users
|
|
|
|
if (!dataStore.get()) dataStore.put(firstTimeState)
|
|
|
|
return new ConfigManager({ store: dataStore })
|
|
|
|
}
|