Skip to content

Commit

Permalink
chore: remove whitelist control
Browse files Browse the repository at this point in the history
  • Loading branch information
chefjackson committed Sep 5, 2024
1 parent c6c19d4 commit c390547
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions apps/web/src/hooks/useAccountEventListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 })
},
Expand Down

0 comments on commit c390547

Please sign in to comment.