Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update chain on network change #2497

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

update chain on network change #2497

wants to merge 4 commits into from

Conversation

glitch-txs
Copy link
Member

Breaking Changes

N/A

Changes

  • feat:
  • fix: update chain on network change
  • chore:

Associated Issues

closes #...

Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Jul 3, 2024 6:57am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Jul 3, 2024 6:57am

@@ -244,11 +244,17 @@ export class Web3Modal extends Web3ModalScaffold {
this.syncNetwork(chainImages)
})

NetworkController.subscribeKey('caipNetwork', () => {
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for aligning naming, could we make it newCaipNetwork?

Suggested change
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
NetworkController.subscribeKey('caipNetwork', (newCaipNetwork: CaipNetwork | undefined) => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I guess you don't have to set type definitions since subscribeKey should already been set the type of the parameter.

Suggested change
NetworkController.subscribeKey('caipNetwork', (newCaipChain: CaipNetwork | undefined) => {
NetworkController.subscribeKey('caipNetwork', (newCaipChain) => {

Copy link
Contributor

@enesozturk enesozturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments @glitch-txs 🙏🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants