aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/migrations/009.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-02-16 03:29:21 +0800
committerGitHub <noreply@github.com>2017-02-16 03:29:21 +0800
commitcdd4faa917a2f02b531c479eb2f05f39f303d51b (patch)
tree2068fb2a606a2cee15256ee986306768a93c26d9 /app/scripts/migrations/009.js
parentec8aa3d1f28e24586031f36151a3b5b5490b3248 (diff)
parent6ef78eb02bf856c85f6acbf3ad8e343ab281f63c (diff)
downloadtangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar.gz
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar.bz2
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar.lz
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar.xz
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.tar.zst
tangerine-wallet-browser-cdd4faa917a2f02b531c479eb2f05f39f303d51b.zip
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.js9
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