You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
Metamask is getting rid of the ethereum.autoRefreshOnNetworkChange property, and suggesting that dApps rely on the ethereum.on("networkChange", callback) listener instead.
Being able to force a dApp to reload on network change can be useful when there is logic that relies on the current networkId. In Drizzle, there is also the problem that web3 contracts that are added ad hoc with addContract would be instantiated with only the current network address, and would fail to function on network change.
The text was updated successfully, but these errors were encountered:
Metamask is getting rid of the ethereum.autoRefreshOnNetworkChange property, and suggesting that dApps rely on the ethereum.on("networkChange", callback) listener instead.
Yes, Drizzle will have to implement this listener.
Being able to force a dApp to reload on network change can be useful when there is logic that relies on the current networkId. In Drizzle, there is also the problem that web3 contracts that are added ad hoc with addContract would be instantiated with only the current network address, and would fail to function on network change.
These lines of code currently repair the contracts when a network change is detected. Though with the observable model Metamask proposes, we'll have to revisit.
Thinking through this it seems like we need a middleware modification to track network changes and update contracts accordingly.
We may also want to consider a unified source of truth around contract info that marries contracts passed in via drizzleOptions with the contracts added via addContract.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Metamask is getting rid of the
ethereum.autoRefreshOnNetworkChange
property, and suggesting that dApps rely on theethereum.on("networkChange", callback)
listener instead.https://metamask.github.io/metamask-docs/API_Reference/Ethereum_Provider#ethereum.autorefreshonnetworkchange
Being able to force a dApp to reload on network change can be useful when there is logic that relies on the current
networkId
. In Drizzle, there is also the problem that web3 contracts that are added ad hoc withaddContract
would be instantiated with only the current network address, and would fail to function on network change.The text was updated successfully, but these errors were encountered: