diff options
Diffstat (limited to 'library/sw-core.js')
-rw-r--r-- | library/sw-core.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/sw-core.js b/library/sw-core.js index 9ceaf1dc5..3972e361b 100644 --- a/library/sw-core.js +++ b/library/sw-core.js @@ -87,7 +87,7 @@ function loadStateFromPersistence() { const initialState = migrator.generateInitialState(firstTimeState) dbController.initialState = initialState return dbController.open() - .then((stuff) => { + .then((openRequest) => { return dbController.get('dataStore') }) .then((data) => { @@ -141,14 +141,14 @@ function setupController (initState, client) { // storeTransform(versionifyData), // diskStore // ) - controller.store.subscribe((store) => { - dbController.put('dataStore', store) - // .then((event) => {debugger}) - // .catch((err) => {debugger}) + controller.store.subscribe((state) => { + dbController.put(versionifyData(controller.store)) + .catch((err) => {console.error(err)}) }) function versionifyData(state) { - let versionedData = diskStore.getState() - versionedData.data = state + // let versionedData = diskStore.getState() + // versionedData.data = state + let versionedData = {data: state} return versionedData } |