Closed ricardocr987 closed 8 months ago
LGTM, but do run npm run lint:fix
and npm run build
to see if you get any build errors. Also:
./src/hooks/pages/useHeader.ts
204:26 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
216:28 Warning: Unexpected any. Specify a different type. @typescript-eslint/no-explicit-any
220:6 Warning: React Hook useEffect has missing dependencies: 'connect' and 'provider'. Either include them or remove the dependency array. react-hooks/exhaustive-deps
The issue was related to how the connect function handled error cases. Previously, all errors were assumed to be network switching cases, but the caught error was actually due to multiple calls to this function (not yet resolved, with the specific error 'wallet_addEthereumChain already pending'). For now, this error is being bypassed.
Changes:
Moved the network switching functionality into a specific function, rather than handling it in the connect function's catch block.
Related:
It's unclear to me how the WalletPicker component shares the state of the selected network with the app. It seems that this state is isolated. WalletPicker Component The handleConnect function is called without a network argument, leading to an undefined state at the end of the call tree. handleConnect Function