Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Adds deep merge for state migration
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Nov 8, 2017
1 parent 145f454 commit 6594a55
Show file tree
Hide file tree
Showing 4 changed files with 1,213 additions and 169 deletions.
3 changes: 2 additions & 1 deletion app/sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const assert = require('assert')
const Immutable = require('immutable')
const app = electron.app
const compareVersions = require('compare-versions')
const merge = require('deepmerge')

// Constants
const UpdateStatus = require('../js/constants/updateStatus')
Expand Down Expand Up @@ -850,7 +851,7 @@ module.exports.loadAppState = () => {
data = {}
}

data = Object.assign({}, module.exports.defaultAppState(), data)
data = merge(module.exports.defaultAppState(), data)
data = module.exports.runImportDefaultSettings(data)
if (loaded) {
data = module.exports.runPreMigrations(data)
Expand Down
Loading

0 comments on commit 6594a55

Please sign in to comment.