mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
disable walletconnect, metamask download fallback (#183)
This commit is contained in:
parent
d5c217dc46
commit
2063f594f6
@ -25,11 +25,15 @@ const Blockies = ({ account }: { account: string | undefined }) => {
|
||||
const Account = React.forwardRef((props, ref: any) => {
|
||||
const { accountId, status, connect, networkId } = useOcean()
|
||||
const hasSuccess = status === 1 && networkId === 1
|
||||
const canHandleWeb3 = window?.web3 || window?.ethereum
|
||||
|
||||
async function handleActivation(e: FormEvent<HTMLButtonElement>) {
|
||||
// prevent accidentially submitting a form the button might be in
|
||||
e.preventDefault()
|
||||
await connect()
|
||||
|
||||
canHandleWeb3
|
||||
? await connect()
|
||||
: (location.href = 'https://metamask.io/download.html')
|
||||
}
|
||||
|
||||
// prevent accidentially submitting a form the button might be in
|
||||
@ -61,7 +65,7 @@ const Account = React.forwardRef((props, ref: any) => {
|
||||
// the Tippy to show in this state.
|
||||
ref={ref}
|
||||
>
|
||||
Connect Wallet
|
||||
{canHandleWeb3 ? 'Connect Wallet' : 'Get MetaMask'}
|
||||
</button>
|
||||
)
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { infuraProjectId, network } from '../../app.config'
|
||||
import WalletConnectProvider from '@walletconnect/web3-provider'
|
||||
// import WalletConnectProvider from '@walletconnect/web3-provider'
|
||||
// import Torus from '@toruslabs/torus-embed'
|
||||
|
||||
const web3ModalTheme = {
|
||||
@ -11,12 +11,12 @@ const web3ModalTheme = {
|
||||
}
|
||||
|
||||
const providerOptions = {
|
||||
walletconnect: {
|
||||
package: WalletConnectProvider,
|
||||
options: {
|
||||
infuraId: infuraProjectId
|
||||
}
|
||||
}
|
||||
// walletconnect: {
|
||||
// package: WalletConnectProvider,
|
||||
// options: {
|
||||
// infuraId: infuraProjectId
|
||||
// }
|
||||
// }
|
||||
// torus: {
|
||||
// package: Torus,
|
||||
// options: {
|
||||
|
Loading…
Reference in New Issue
Block a user