Commit e0eb701b authored by cartcrom's avatar cartcrom Committed by GitHub

feat: log connection activation/errors (#6333)

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

* fix: remove now-redundant comment
parent 36cb0668
...@@ -156,15 +156,16 @@ export default function WalletModal({ openSettings }: { openSettings: () => void ...@@ -156,15 +156,16 @@ export default function WalletModal({ openSettings }: { openSettings: () => void
setPendingError(undefined) setPendingError(undefined)
await connection.connector.activate() await connection.connector.activate()
console.debug(`connection activated: ${connection.getName()}`)
dispatch(updateSelectedWallet({ wallet: connection.type })) dispatch(updateSelectedWallet({ wallet: connection.type }))
if (drawerOpenRef.current) toggleWalletDrawer() if (drawerOpenRef.current) toggleWalletDrawer()
} catch (error) { } 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)) { if (didUserReject(connection, error)) {
setPendingConnection(undefined) setPendingConnection(undefined)
} // Prevents showing error caused by MetaMask being prompted twice } else {
else if (error?.code !== ErrorCode.MM_ALREADY_PENDING) { setPendingError(error)
console.debug(`web3-react connection error: ${error}`)
setPendingError(error.message)
sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECT_TXN_COMPLETED, { sendAnalyticsEvent(InterfaceEventName.WALLET_CONNECT_TXN_COMPLETED, {
result: WalletConnectionResult.FAILED, result: WalletConnectionResult.FAILED,
......
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