mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-30 08:09:15 +01:00
bb87a0b92c
The `seedWords` state was removed from the PreferencesController recently in #6920. That state hadn't been used in some time, and there was a long period during which `seedWords` was periodically scrubbed from the state, so it's highly unlikely that it still exists in state for most users. It's hard to guarantee that it _doesn't_ though, especially if a user hasn't opened MetaMask in a few months.
29 lines
593 B
JavaScript
29 lines
593 B
JavaScript
// next version number
|
|
const version = 35
|
|
|
|
/*
|
|
|
|
Removes the deprecated 'seedWords' state
|
|
|
|
*/
|
|
|
|
const clone = require('clone')
|
|
|
|
module.exports = {
|
|
version,
|
|
|
|
migrate: async function (originalVersionedData) {
|
|
const versionedData = clone(originalVersionedData)
|
|
versionedData.meta.version = version
|
|
versionedData.data = transformState(versionedData.data)
|
|
return versionedData
|
|
},
|
|
}
|
|
|
|
function transformState (state) {
|
|
if (state.PreferencesController && state.PreferencesController.seedWords !== undefined) {
|
|
delete state.PreferencesController.seedWords
|
|
}
|
|
return state
|
|
}
|