diff options
Merge pull request #1117 from MetaMask/disclaimer-clean
Migration Testing
Diffstat (limited to 'app/scripts/migrations/009.js')
-rw-r--r-- | app/scripts/migrations/009.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/scripts/migrations/009.js b/app/scripts/migrations/009.js index 38e6dcc09..4612fefdc 100644 --- a/app/scripts/migrations/009.js +++ b/app/scripts/migrations/009.js @@ -7,11 +7,13 @@ This migration breaks out the CurrencyController substate */ const merge = require('deep-extend') +const clone = require('clone') module.exports = { - version, + version, - migrate: function (versionedData) { + migrate: function (originalVersionedData) { + let versionedData = clone(originalVersionedData) versionedData.meta.version = version try { const state = versionedData.data @@ -27,12 +29,13 @@ module.exports = { function transformState (state) { const newState = merge({}, state, { CurrencyController: { - currentCurrency: state.currentFiat || 'USD', + currentCurrency: state.currentFiat || state.fiatCurrency || 'USD', conversionRate: state.conversionRate, conversionDate: state.conversionDate, }, }) delete newState.currentFiat + delete newState.fiatCurrency delete newState.conversionRate delete newState.conversionDate |