Skip to content

Commit

Permalink
Remove Cosmos devnets from production community creation (#6606)
Browse files Browse the repository at this point in the history
* remove cosmos devnets from prod selection

* move filter to constants.ts
  • Loading branch information
timolegros authored Feb 14, 2024
1 parent 61a7e00 commit 8e49377
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ export const existingCommunityNames = app.config.chains
.getAll()
.map((community) => community.name.toLowerCase().trim());

const removeTestCosmosNodes = (nodeInfo: NodeInfo): boolean => {
return !(
window.location.hostname.includes('commonwealth.im') &&
[
'evmosdevci',
'csdkv1',
'csdkbeta',
'csdkv1ci',
'csdkbetaci',
'evmosdev',
].includes(String(nodeInfo.cosmosChainId))
);
};

const particularChainNodes = (nodeInfo: NodeInfo) => {
const isEth = nodeInfo.ethChainId;
const isCosmos = nodeInfo.cosmosChainId;
Expand All @@ -18,7 +32,10 @@ const particularChainNodes = (nodeInfo: NodeInfo) => {
nodeInfo.name.toLowerCase().includes('mainnet');
const isPolygon = nodeInfo.ethChainId === POLYGON_ETH_CHAIN_ID;

return isEth || isCosmos || isSolana || isPolygon;
return (
removeTestCosmosNodes(nodeInfo) &&
(isEth || isCosmos || isSolana || isPolygon)
);
};

// Get chain id's from the app.config.chains for all eth and cosmos chains
Expand Down

0 comments on commit 8e49377

Please sign in to comment.