Skip to content

Commit c7f47d9

Browse files
fix: resolve bad default config resolution
1 parent 056caa0 commit c7f47d9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/common/utils/config.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ const networkConfigs = [
133133
},
134134
];
135135

136+
const getConfig = (chainId) =>
137+
networkConfigs.find(
138+
(networkConfig) => `${networkConfig.id}` === `${chainId}`,
139+
);
140+
136141
export const getId = (idOrName, { allowExperimentalNetworks = false } = {}) =>
137142
networkConfigs
138143
.filter(
@@ -186,10 +191,11 @@ export const getChainDefaults = (
186191
};
187192
};
188193

194+
export const shouldUploadBulkForThegraph = (chainId) =>
195+
getConfig(chainId)?.uploadBulkForThegraph || false;
196+
189197
export const checkImplementedOnChain = (chainId, featureName) => {
190-
const networkConfig = networkConfigs.find(
191-
(network) => `${network.id}` === `${chainId}`,
192-
);
198+
const networkConfig = getConfig(chainId);
193199
if (
194200
networkConfig?.notImplemented &&
195201
networkConfig.notImplemented.includes(featureName)
@@ -216,8 +222,5 @@ networkConfigs.forEach((networkConfig) => {
216222
}
217223
});
218224

219-
export const shouldUploadBulkForThegraph = (id) =>
220-
networkConfigs[id]?.uploadBulkForThegraph || false;
221-
222225
export const THEGRAPH_IPFS_NODE = 'https://ipfs.thegraph.com';
223226
export const THEGRAPH_IPFS_GATEWAY = THEGRAPH_IPFS_NODE;

0 commit comments

Comments
 (0)