2023-02-16 20:23:29 +01:00
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
|
|
2023-03-06 14:36:01 +01:00
|
|
|
const version = 80;
|
2023-02-16 20:23:29 +01:00
|
|
|
|
|
|
|
/**
|
2023-03-06 14:36:01 +01:00
|
|
|
* The portfolio tooltip has been moved to a button on the home screen so
|
|
|
|
* this property is no longer needed in state
|
2023-02-16 20:23:29 +01:00
|
|
|
*/
|
|
|
|
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) {
|
2023-03-06 14:36:01 +01:00
|
|
|
if (state?.metamask?.showPortfolioTooltip !== undefined) {
|
|
|
|
delete state.metamask.showPortfolioTooltip;
|
2023-02-16 20:23:29 +01:00
|
|
|
}
|
2023-03-06 14:36:01 +01:00
|
|
|
|
2023-02-16 20:23:29 +01:00
|
|
|
return state;
|
|
|
|
}
|