-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from cb-jake/disable-openmev-for-cb
feat: disable openmev for cb wallet
- Loading branch information
Showing
6 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { InjectedConnector } from '@web3-react/injected-connector' | ||
import { WalletLinkConnector } from '@web3-react/walletlink-connector' | ||
import { useActiveWeb3React } from 'app/services/web3' | ||
import { useMemo } from 'react' | ||
|
||
export default function useIsCoinbaseWallet(): boolean { | ||
const { connector } = useActiveWeb3React() | ||
return useMemo(() => { | ||
return ( | ||
connector instanceof WalletLinkConnector || | ||
(connector instanceof InjectedConnector && window.walletLinkExtension) || | ||
window?.ethereum?.isCoinbaseWallet | ||
) | ||
}, [connector]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import useIsCoinbaseWallet from './useIsCoinbaseWallet' | ||
|
||
export default function useWalletSupportsOpenMev() { | ||
const isCoinbaseWallet = useIsCoinbaseWallet() | ||
if (isCoinbaseWallet) return false | ||
return true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5f512a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: