diff --git a/common/selectors/config/networks.ts b/common/selectors/config/networks.ts index bfa1acea..f57081c2 100644 --- a/common/selectors/config/networks.ts +++ b/common/selectors/config/networks.ts @@ -31,6 +31,8 @@ export const getStaticNetworkConfig = (state: AppState): StaticNetworkConfig | u return defaultNetwork; }; +export const getSelectedNetwork = (state: AppState) => getNetworks(state).selectedNetwork; + export const getCustomNetworkConfig = (state: AppState): CustomNetworkConfig | undefined => { const { customNetworks, selectedNetwork } = getNetworks(state); const customNetwork = customNetworks[selectedNetwork]; diff --git a/common/selectors/config/nodes.ts b/common/selectors/config/nodes.ts index c017e35f..fb86f2db 100644 --- a/common/selectors/config/nodes.ts +++ b/common/selectors/config/nodes.ts @@ -82,12 +82,16 @@ export function getStaticNodes(state: AppState) { return getNodes(state).staticNodes; } +export function getSelectedNode(state: AppState) { + return getNodes(state).selectedNode; +} + export function isNodeChanging(state): boolean { - return getNodes(state).selectedNode.pending; + return getSelectedNode(state).pending; } export function getNodeId(state: AppState): string { - return getNodes(state).selectedNode.nodeId; + return getSelectedNode(state).nodeId; } export function getIsWeb3Node(state: AppState): boolean {