mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix - migration 30 undefinds (#6079)
This commit is contained in:
parent
7c0e0b6065
commit
4e27b644ab
@ -24,23 +24,25 @@ module.exports = {
|
||||
|
||||
function transformState (state) {
|
||||
const newState = state
|
||||
|
||||
const frequentRpcListDetail = newState.PreferencesController.frequentRpcListDetail
|
||||
if (frequentRpcListDetail) {
|
||||
frequentRpcListDetail.forEach((rpc, index) => {
|
||||
if (!!rpc.chainId && Number.isNaN(parseInt(rpc.chainId))) {
|
||||
delete frequentRpcListDetail[index].chainId
|
||||
}
|
||||
})
|
||||
newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail
|
||||
if (state.PreferencesController) {
|
||||
const frequentRpcListDetail = newState.PreferencesController.frequentRpcListDetail
|
||||
if (frequentRpcListDetail) {
|
||||
frequentRpcListDetail.forEach((rpc, index) => {
|
||||
if (!!rpc.chainId && Number.isNaN(parseInt(rpc.chainId))) {
|
||||
delete frequentRpcListDetail[index].chainId
|
||||
}
|
||||
})
|
||||
newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail
|
||||
}
|
||||
}
|
||||
if (state.NetworkController) {
|
||||
if (newState.NetworkController.network && Number.isNaN(parseInt(newState.NetworkController.network))) {
|
||||
delete newState.NetworkController.network
|
||||
}
|
||||
|
||||
if (newState.NetworkController.network && Number.isNaN(parseInt(newState.NetworkController.network))) {
|
||||
delete newState.NetworkController.network
|
||||
}
|
||||
|
||||
if (newState.NetworkController.provider && newState.NetworkController.provider.chainId && Number.isNaN(parseInt(newState.NetworkController.provider.chainId))) {
|
||||
delete newState.NetworkController.provider.chainId
|
||||
if (newState.NetworkController.provider && newState.NetworkController.provider.chainId && Number.isNaN(parseInt(newState.NetworkController.provider.chainId))) {
|
||||
delete newState.NetworkController.provider.chainId
|
||||
}
|
||||
}
|
||||
|
||||
return newState
|
||||
|
Loading…
Reference in New Issue
Block a user