|
|
@ -24,7 +24,7 @@ module.exports = { |
|
|
|
|
|
|
|
|
|
|
|
function transformState (state) { |
|
|
|
function transformState (state) { |
|
|
|
const newState = state |
|
|
|
const newState = state |
|
|
|
|
|
|
|
if (state.PreferencesController) { |
|
|
|
const frequentRpcListDetail = newState.PreferencesController.frequentRpcListDetail |
|
|
|
const frequentRpcListDetail = newState.PreferencesController.frequentRpcListDetail |
|
|
|
if (frequentRpcListDetail) { |
|
|
|
if (frequentRpcListDetail) { |
|
|
|
frequentRpcListDetail.forEach((rpc, index) => { |
|
|
|
frequentRpcListDetail.forEach((rpc, index) => { |
|
|
@ -34,7 +34,8 @@ function transformState (state) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail |
|
|
|
newState.PreferencesController.frequentRpcListDetail = frequentRpcListDetail |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (state.NetworkController) { |
|
|
|
if (newState.NetworkController.network && Number.isNaN(parseInt(newState.NetworkController.network))) { |
|
|
|
if (newState.NetworkController.network && Number.isNaN(parseInt(newState.NetworkController.network))) { |
|
|
|
delete newState.NetworkController.network |
|
|
|
delete newState.NetworkController.network |
|
|
|
} |
|
|
|
} |
|
|
@ -42,6 +43,7 @@ function transformState (state) { |
|
|
|
if (newState.NetworkController.provider && newState.NetworkController.provider.chainId && Number.isNaN(parseInt(newState.NetworkController.provider.chainId))) { |
|
|
|
if (newState.NetworkController.provider && newState.NetworkController.provider.chainId && Number.isNaN(parseInt(newState.NetworkController.provider.chainId))) { |
|
|
|
delete newState.NetworkController.provider.chainId |
|
|
|
delete newState.NetworkController.provider.chainId |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return newState |
|
|
|
return newState |
|
|
|
} |
|
|
|
} |
|
|
|