From b3c8073b90295ddae4fb4eee60cb91996b39c218 Mon Sep 17 00:00:00 2001 From: microHoffman Date: Sat, 30 Nov 2024 15:00:21 +0000 Subject: [PATCH] ci: fix --- .github/workflows/deploy.yml | 2 +- constants.ts | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c8c0122..38b0d14 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -51,8 +51,8 @@ jobs: with: file: "env/${{ env.ENV_FILE }}" replace-all: | - NEXT_PUBLIC_ETHEREUM_RPC_URL=${{ secrets.NEXT_PUBLIC_ETHEREUM_RPC_URL }} NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }} + NEXT_PUBLIC_ETHEREUM_RPC_URL=${{ secrets.NEXT_PUBLIC_ETHEREUM_RPC_URL }} NEXT_PUBLIC_SEPOLIA_RPC_URL=${{ secrets.NEXT_PUBLIC_SEPOLIA_RPC_URL }} NEXT_PUBLIC_WEB3_STORAGE_KEY=${{ secrets.NEXT_PUBLIC_WEB3_STORAGE_KEY }} NEXT_PUBLIC_ETHERSCAN_API_KEY=${{ secrets.NEXT_PUBLIC_ETHERSCAN_API_KEY }} diff --git a/constants.ts b/constants.ts index 10eb207..80b77dd 100644 --- a/constants.ts +++ b/constants.ts @@ -40,17 +40,14 @@ export const PUB_TOKEN_VOTING_PLUGIN_ADDRESS = { [11155111]: "0xED79E70122E06bB036EB6668e772FaCE4566a4cC", } as const satisfies ContractAddressRegistry; -const getEnabledChains = (): [AppKitNetwork, ...AppKitNetwork[]] => { - if (process.env.NEXT_PUBLIC_ENABLED_CHAIN_IDS?.includes(",")) { - // multiple chains enabled - return process.env.NEXT_PUBLIC_ENABLED_CHAIN_IDS.split(",").map((chainId) => - getAppKitChain(Number(chainId) as ChainId) - ) as [AppKitNetwork, ...AppKitNetwork[]]; - } else { - return [getAppKitChain(Number(process.env.NEXT_PUBLIC_ENABLED_CHAIN_IDS) as ChainId)]; - } -}; -export const ENABLED_CHAINS = getEnabledChains(); +const ENABLED_CHAIN_IDS = process.env.NEXT_PUBLIC_ENABLED_CHAIN_IDS!; + +export const ENABLED_CHAINS = ( + ENABLED_CHAIN_IDS.includes(",") + ? ENABLED_CHAIN_IDS.split(",").map((chainId) => getAppKitChain(Number(chainId) as ChainId)) + : [getAppKitChain(Number(process.env.NEXT_PUBLIC_ENABLED_CHAIN_IDS) as ChainId)] +) as [AppKitNetwork, ...AppKitNetwork[]]; + export const PREFERRED_CHAIN = getAppKitChain(Number(process.env.NEXT_PUBLIC_PREFERRED_CHAIN_ID) as ChainId); export const PUB_IPFS_ENDPOINTS = process.env.NEXT_PUBLIC_IPFS_ENDPOINTS as string;