feat: log connection activation/errors (#6333)

* feat: log connection activation/errors in console.debug

* fix: remove now-redundant comment
This commit is contained in:
cartcrom 2023-04-12 10:36:01 -04:00 committed by GitHub
parent 36cb0668a3
commit e0eb701bc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -156,15 +156,16 @@ export default function WalletModal({ openSettings }: { openSettings: () => void
setPendingError(undefined)
await connection.connector.activate()
console.debug(`connection activated: ${connection.getName()}`)
dispatch(updateSelectedWallet({ wallet: connection.type }))
if (drawerOpenRef.current) toggleWalletDrawer()
} catch (error) {
console.debug(`web3-react connection error: ${error}`)
// TODO(WEB-3162): re-add special treatment for already-pending injected errors
if (didUserReject(connection, error)) {
setPendingConnection(undefined)
} // Prevents showing error caused by MetaMask being prompted twice
else if (error?.code !== ErrorCode.MM_ALREADY_PENDING) {
console.debug(`web3-react connection error: ${error}`)
setPendingError(error.message)
} else {
setPendingError(error)
sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECT_TXN_COMPLETED, {
result: WalletConnectionResult.FAILED,