Skip to content

Commit

Permalink
🔥 remove allowedNetworks file
Browse files Browse the repository at this point in the history
  • Loading branch information
JuampiRombola authored and franm91 committed Dec 30, 2022
1 parent 209e6da commit 057be68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { useWeb3 } from 'hooks/useWeb3';

import { AppBar, Box, Chip, IconButton, Toolbar } from '@mui/material';
import MenuIcon from '@mui/icons-material/Menu';
import allowedNetworks from 'config/allowedNetworks.json';
import { globals } from 'styles/theme';
import analytics from 'utils/analytics';
import { useModalStatus } from 'contexts/ModalStatusContext';
import MobileMenu from 'components/MobileMenu';
import Link from 'next/link';
import Wallet from 'components/Wallet';
import SelectNetwork from 'components/SelectNetwork';
import { allowedChains } from 'utils/client';
const { maxWidth, onlyMobile, onlyDesktop, onlyDesktopFlex } = globals;

const routes = [
Expand All @@ -38,16 +38,16 @@ function Navbar() {
walletAddress && void analytics.identify(walletAddress);
}, [walletAddress]);

const isAllowed = useMemo(() => chain && allowedNetworks.includes(chain.network), [chain]);
const isSupportedChain = useMemo(() => chain?.id && allowedChains.map((c) => c.id).includes(chain.id), [chain?.id]);

async function handleFaucetClick() {
if (!switchNetworkAsync) return;

if (isAllowed && chain?.id === goerli.id) {
if (isSupportedChain && chain?.id === goerli.id) {
return openOperationModal('faucet');
}

if (!isAllowed) await switchNetworkAsync(goerli.id);
if (!isSupportedChain) await switchNetworkAsync(goerli.id);
}

return (
Expand Down
1 change: 0 additions & 1 deletion config/allowedNetworks.json

This file was deleted.

0 comments on commit 057be68

Please sign in to comment.