Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only emit state change events after initialization (#117)
It was reported in #110 that `chainChanged` (and by extension, `networkChanged`) is sometimes emitted for the first time after page load, causing a reload loop for those handling chain changes by reloading the page. When the `chainId` is set on initialization, the chain has not changed, and `chainChanged` should not be emitted. The same can be said for `accountsChanged`, which currently would emit under the same circumstances. This PR ensures that `chainChanged`, `networkChanged`, and `accountsChanged` are only emitted after the provider has been initialized.
- Loading branch information