2023-02-21 16:32:08 +01:00
|
|
|
import { cloneDeep } from 'lodash';
|
|
|
|
|
|
|
|
const version = 79;
|
|
|
|
|
|
|
|
/**
|
2023-03-06 14:36:01 +01:00
|
|
|
* Remove collectiblesDropdownState and collectiblesDetectionNoticeDismissed:.
|
2023-02-21 16:32:08 +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?.AppStateController?.collectiblesDetectionNoticeDismissed !==
|
|
|
|
undefined
|
|
|
|
) {
|
|
|
|
delete state.AppStateController.collectiblesDetectionNoticeDismissed;
|
|
|
|
}
|
|
|
|
if (state?.metamask?.collectiblesDropdownState !== undefined) {
|
|
|
|
delete state.metamask.collectiblesDropdownState;
|
2023-02-21 16:32:08 +01:00
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|