web3-react improvement (#581)
* fix SC errors * improve unsupported chain id error * bump yarn.lock
This commit is contained in:
parent
64296d8229
commit
e92c8ed5e8
@ -1,6 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import { transparentize } from 'polished'
|
|
||||||
import { Link } from '../../theme'
|
import { Link } from '../../theme'
|
||||||
|
|
||||||
const InfoCard = styled.button`
|
const InfoCard = styled.button`
|
||||||
@ -10,7 +9,6 @@ const InfoCard = styled.button`
|
|||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
: 0 4px 8px 0 ${({ theme, clickable }) => (clickable ? transparentize(0.95, theme.shadowColor) : 'none')};
|
|
||||||
&:focus {
|
&:focus {
|
||||||
box-shadow: 0 0 0 1px ${({ theme }) => theme.royalBlue};
|
box-shadow: 0 0 0 1px ${({ theme }) => theme.royalBlue};
|
||||||
}
|
}
|
||||||
|
@ -171,8 +171,12 @@ export default function WalletModal({ pendingTransactions, confirmedTransactions
|
|||||||
})
|
})
|
||||||
setPendingWallet(connector) // set wallet for pending view
|
setPendingWallet(connector) // set wallet for pending view
|
||||||
setWalletView(WALLET_VIEWS.PENDING)
|
setWalletView(WALLET_VIEWS.PENDING)
|
||||||
activate(connector, undefined, true).catch(e => {
|
activate(connector, undefined, true).catch(error => {
|
||||||
setPendingError(true)
|
if (error instanceof UnsupportedChainIdError) {
|
||||||
|
activate(connector) // a little janky...can't use setError because the connector isn't set
|
||||||
|
} else {
|
||||||
|
setPendingError(true)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user