Skip to content

Commit

Permalink
fix: bug about not being able to switch back to amoy in testing/stagi…
Browse files Browse the repository at this point in the history
…ng (#1085)
  • Loading branch information
albertfolch-redeemeum authored Jun 3, 2024
1 parent d2ed435 commit 394a9df
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/components/header/selector/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ChainSelector = ({ leftAlign }: ChainSelectorProps) => {
(config) => {
return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
!TESTNET_CHAIN_IDS.includes(config.chainId as any)
TESTNET_CHAIN_IDS.includes(config.chainId as any)
);
}
)
Expand Down
8 changes: 4 additions & 4 deletions src/lib/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [

export const TESTNET_CHAIN_IDS = [
ChainId.GOERLI,
// ChainId.SEPOLIA,
ChainId.SEPOLIA,
ChainId.POLYGON_MUMBAI,
80002,
ChainId_POLYGON_AMOY,
LocalChainId
// ChainId.ARBITRUM_GOERLI,
// ChainId.OPTIMISM_GOERLI,
Expand All @@ -127,7 +127,7 @@ export const L1_CHAIN_IDS = [
// ChainId.SEPOLIA,
ChainId.POLYGON,
ChainId.POLYGON_MUMBAI,
80002,
ChainId_POLYGON_AMOY,
LocalChainId
// ChainId.CELO,
// ChainId.CELO_ALFAJORES
Expand Down Expand Up @@ -165,7 +165,7 @@ export function getChainPriority(chainId: number): number {
return 0;
case ChainId.POLYGON:
case ChainId.POLYGON_MUMBAI:
case 80002:
case ChainId_POLYGON_AMOY:
return 1;
// case ChainId.ARBITRUM_ONE:
// case ChainId.ARBITRUM_GOERLI:
Expand Down
17 changes: 7 additions & 10 deletions src/lib/utils/hooks/useSyncChainQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,14 @@ export default function useSyncChainQuery() {
// connecting

if (!isSupportedChain(chainId)) {
{
// connecting account to an unsupported chain ${chainId}
const configIdToConnect = (urlConfigId ||
currentConfigId) as ConfigId;
selectChain(configIdToConnect);
// connecting account to an unsupported chain ${chainId}
const configIdToConnect = (urlConfigId || currentConfigId) as ConfigId;
selectChain(configIdToConnect);

if (configIdToConnect) {
searchParams.set(configQueryParameters.configId, configIdToConnect);
setSearchParams(searchParams);
configIdRef.current = configIdToConnect;
}
if (configIdToConnect) {
searchParams.set(configQueryParameters.configId, configIdToConnect);
setSearchParams(searchParams);
configIdRef.current = configIdToConnect;
}
}
}
Expand Down

0 comments on commit 394a9df

Please sign in to comment.