Commit ece68a0e authored by Jordan Frankfurt's avatar Jordan Frankfurt

fix: close wallet modal on connection (#53)

fix: hide celo on uniswap wallet connections (#48)

* fix: hide celo on uniswap wallet connections

* add disabled UI instead of removing network from list

Revert "fix: hide celo on uniswap wallet connections (#48)"

This reverts commit b22d82545fef6812b22fe1adc3f281588642c9cd.
parent fd212477
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import useDebounce from 'hooks/useDebounce' import useDebounce from 'hooks/useDebounce'
import useIsWindowVisible from 'hooks/useIsWindowVisible' import useIsWindowVisible from 'hooks/useIsWindowVisible'
import { useEffect, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { useAppDispatch } from 'state/hooks' import { useAppDispatch } from 'state/hooks'
import { supportedChainId } from 'utils/supportedChainId' import { supportedChainId } from 'utils/supportedChainId'
import { updateChainId } from './reducer' import { useCloseModal } from './hooks'
import { ApplicationModal, updateChainId } from './reducer'
export default function Updater(): null { export default function Updater(): null {
const { chainId, provider } = useWeb3React() const { account, chainId, provider } = useWeb3React()
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
const windowVisible = useIsWindowVisible() const windowVisible = useIsWindowVisible()
const [activeChainId, setActiveChainId] = useState(chainId) const [activeChainId, setActiveChainId] = useState(chainId)
const closeModal = useCloseModal(ApplicationModal.WALLET_DROPDOWN)
const previousAccountValue = useRef(account)
useEffect(() => {
if (account && account !== previousAccountValue.current) {
previousAccountValue.current = account
closeModal()
}
}, [account, closeModal])
useEffect(() => { useEffect(() => {
if (provider && chainId && windowVisible) { if (provider && chainId && windowVisible) {
setActiveChainId(chainId) setActiveChainId(chainId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment