From cd75d861874f300fdca7b20274d170d0023d6caf Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 14 Feb 2017 13:21:00 -0800 Subject: Add migrations for removing terms of use data. --- app/scripts/migrations/011.js | 30 ++++++++++++++++++++++++++++++ app/scripts/migrations/index.js | 1 + 2 files changed, 31 insertions(+) create mode 100644 app/scripts/migrations/011.js (limited to 'app') diff --git a/app/scripts/migrations/011.js b/app/scripts/migrations/011.js new file mode 100644 index 000000000..227fd87f7 --- /dev/null +++ b/app/scripts/migrations/011.js @@ -0,0 +1,30 @@ +const version = 11 + +/* + +This migration breaks out the CurrencyController substate + +*/ + +module.exports = { + version, + + migrate: function (versionedData) { + versionedData.meta.version = version + try { + const state = versionedData.data + const newState = transformState(state) + versionedData.data = newState + } catch (err) { + console.warn(`MetaMask Migration #${version}` + err.stack) + } + return Promise.resolve(versionedData) + }, +} + +function transformState (state) { + const newState = state + delete newState.TOSHash + delete newState.isDisclaimerConfirmed + return newState +} diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index 2db8646b0..a3dd48c17 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -21,4 +21,5 @@ module.exports = [ require('./008'), require('./009'), require('./010'), + require('./011'), ] -- cgit v1.2.3