1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/app/scripts/migrations/079.js
Dan J Miller a5dcc60697
Change migration 78 version to 79, 79 to 80 and 80 to 78 (so that the… (#17980)
* 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
2023-03-06 10:06:01 -03:30

32 lines
819 B
JavaScript

import { cloneDeep } from 'lodash';
const version = 79;
/**
* Remove collectiblesDropdownState and collectiblesDetectionNoticeDismissed:.
*/
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?.AppStateController?.collectiblesDetectionNoticeDismissed !==
undefined
) {
delete state.AppStateController.collectiblesDetectionNoticeDismissed;
}
if (state?.metamask?.collectiblesDropdownState !== undefined) {
delete state.metamask.collectiblesDropdownState;
}
return state;
}