From 86f8302d2b80cc303584e9c9e8ae3fce6c341466 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 Date: Sat, 27 Jan 2018 15:20:47 -0500 Subject: [PATCH] Change custom network typing --- common/reducers/config/networks/customNetworks.ts | 4 +--- common/selectors/config/networks.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/reducers/config/networks/customNetworks.ts b/common/reducers/config/networks/customNetworks.ts index b7269f42..d9712c4d 100644 --- a/common/reducers/config/networks/customNetworks.ts +++ b/common/reducers/config/networks/customNetworks.ts @@ -7,12 +7,10 @@ import { import { CustomNetworkConfig } from 'reducers/config/networks/typings'; // TODO: this doesn't accurately represent state, as -interface State1 { +export interface State { [customNetworkId: string]: CustomNetworkConfig; } -export type State = Partial; - const addCustomNetwork = (state: State, { payload }: AddCustomNetworkAction): State => ({ ...state, [payload.id]: payload.config diff --git a/common/selectors/config/networks.ts b/common/selectors/config/networks.ts index bd0fe758..c45793f7 100644 --- a/common/selectors/config/networks.ts +++ b/common/selectors/config/networks.ts @@ -35,7 +35,7 @@ export const getNetworkContracts = (state: AppState): NetworkContract[] | null = return network ? network.contracts : []; }; -export const getCustomNetworkConfigs = (state: AppState): (CustomNetworkConfig | undefined)[] => { +export const getCustomNetworkConfigs = (state: AppState): CustomNetworkConfig[] => { const { customNetworks } = getNetworks(state); return Object.values(customNetworks); };