aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/background.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-01-13 06:40:04 +0800
committerkumavis <aaron@kumavis.me>2017-01-13 06:40:04 +0800
commitbc1615f032186e88aebfa9dac38039dcff263162 (patch)
tree9d5996898a5b950e1fc70fbc7bb16db23d25f0a4 /app/scripts/background.js
parent80514d73b5bc6887cea877194091c941cfb9a8e6 (diff)
downloadtangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar.gz
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar.bz2
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar.lz
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar.xz
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.tar.zst
tangerine-wallet-browser-bc1615f032186e88aebfa9dac38039dcff263162.zip
background - fix metamaskController store -> diskStore persistence
Diffstat (limited to 'app/scripts/background.js')
-rw-r--r--app/scripts/background.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 0e5a76d51..1f269da7b 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -5,6 +5,7 @@ const asyncQ = require('async-q')
const Migrator = require('./lib/migrator/')
const migrations = require('./lib/migrations/')
const LocalStorageStore = require('./lib/observable/local-storage')
+const synchronizeStore = require('./lib/observable/util/sync')
const PortStream = require('./lib/port-stream.js')
const notification = require('./lib/notifications.js')
const messageManager = require('./lib/message-manager')
@@ -68,7 +69,11 @@ function setupController (initState) {
global.metamaskController = controller
// setup state persistence
- controller.store.subscribe((newState) => diskStore)
+ synchronizeStore(controller.store, diskStore, (state) => {
+ let versionedData = diskStore.get()
+ versionedData.data = state
+ return versionedData
+ })
//
// connect to other contexts