From c390547c4f38d7a7ace8db90ba0826a5a00be53c Mon Sep 17 00:00:00 2001 From: chefjackson <116779127+chefjackson@users.noreply.github.com> Date: Tue, 3 Sep 2024 17:28:18 +0800 Subject: [PATCH] chore: remove whitelist control --- apps/web/src/hooks/useAccountEventListener.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/apps/web/src/hooks/useAccountEventListener.ts b/apps/web/src/hooks/useAccountEventListener.ts index 62a20c3e1c3218..dcf856f1a6583e 100644 --- a/apps/web/src/hooks/useAccountEventListener.ts +++ b/apps/web/src/hooks/useAccountEventListener.ts @@ -2,7 +2,6 @@ import { watchAccount } from '@wagmi/core' import { useCallback, useEffect } from 'react' import { useAppDispatch } from 'state' import { clearUserStates } from 'utils/clearUserStates' -import { Address, isAddressEqual } from 'viem' import { useAccount, useAccountEffect, useConfig } from 'wagmi' import { useSwitchNetworkLocal } from './useSwitchNetwork' @@ -49,18 +48,6 @@ export const useAccountEventListener = () => { useAddressListener() useAccountEffect({ - onConnect(data) { - const { address } = data - if (!address) return - // x whitelist - const whiteListedAddresses = (process.env.NEXT_PUBLIC_X_WHITELISTED_ADDRESSES?.split(',') ?? []) as Address[] - if ( - whiteListedAddresses.length === 0 || - !whiteListedAddresses.some((whiteListedAddress) => isAddressEqual(address, whiteListedAddress)) - ) { - window.location.replace('https://pancakeswap.finance') - } - }, onDisconnect() { clearUserStates(dispatch, { chainId }) },