mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
a5dcc60697
* Change migration 78 version to 79, 79 to 80 and 80 to 78 (so that the new 78 can be picked into an RC) * Update migration imports
28 lines
674 B
JavaScript
28 lines
674 B
JavaScript
import { cloneDeep } from 'lodash';
|
|
|
|
const version = 80;
|
|
|
|
/**
|
|
* The portfolio tooltip has been moved to a button on the home screen so
|
|
* this property is no longer needed in state
|
|
*/
|
|
export default {
|
|
version,
|
|
async migrate(originalVersionedData) {
|
|
const versionedData = cloneDeep(originalVersionedData);
|
|
versionedData.meta.version = version;
|
|
const state = versionedData.data;
|
|
const newState = transformState(state);
|
|
versionedData.data = newState;
|
|
return versionedData;
|
|
},
|
|
};
|
|
|
|
function transformState(state) {
|
|
if (state?.metamask?.showPortfolioTooltip !== undefined) {
|
|
delete state.metamask.showPortfolioTooltip;
|
|
}
|
|
|
|
return state;
|
|
}
|