-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set chain id based on the env variable
Define the chain id based on the env variable and use it in the `connect` function from wagmi. We have separate builds for each network and we do not change chain dynamically so we can use hardcoded value in `connect` function. If we use the `useChainId` hook from wagmi it will return the cached chain id. So when for example we were locally testing a dapp on the testnet and then changed the env variables to integrate with the mainnet, the wagmi used the cached chain id for the testnet and we couldn't connect to the wallet.
- Loading branch information
1 parent
7a8935b
commit a2a545f
Showing
2 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters