-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Issue #2565]
network config extended
#2609
[Issue #2565]
network config extended
#2609
Conversation
✅ Deploy Preview for decent-interface-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const { switchChain } = useSwitchChain({ | ||
mutation: { | ||
onError: () => { | ||
if (addressPrefix !== urlAddressPrefix && urlAddressPrefix !== undefined) { | ||
const chainId = getChainIdFromPrefix(urlAddressPrefix); | ||
switchChain({ chainId }); | ||
} | ||
}, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny enough, this kinda reverts back to how the file was before only this now we are attempting the switch chain again onError.
While, not ideal. this does work and fixes the current network switcher issues we've been having. Ideally I think we would have completely seperate publicClient
by passing the id
directly in. and then move all network switching to when a user clicks to send a transaction.
But I'm not sure how that scales at the moment and want to discuss further before we make that change.
So this is the current path of least resistance. currently there are two spots that this is going to be required.
useAutomaticSwitchChain
EstablishEssentials
where a new network switcher will exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another. I'll create any other PRs for anything pre-existing issues off develop I find while testing so keep an eye out for those.
And one PR branched from here to updates the DAO search to be cross-chain per @adamgall suggestion.
- I have another commit to add the SwitchChain to the network switcher in DAO creation coming and this will be good for other testers starting tomorrow
…dao/decent-interface into issue/2565-network-config-extended
…dao/decent-interface into issue/2565-network-config-extended
…dao/decent-interface into issue/2565-network-config-extended
Okay, I feel like this is good as its going to get in its current form. There is a flash of the network error screen, but that was always there before, but now it actually loads. I think the state refactor will help this get rid of the flash. |
…turn found network prefixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 very minor comment, but otherwise - looks good!
transports: supportedNetworks.reduce(transportsReducer, {}), | ||
batch: { | ||
multicall: true, | ||
}, | ||
}); | ||
|
||
if (walletConnectProjectId) { | ||
createWeb3Modal({ wagmiConfig, projectId: walletConnectProjectId }); | ||
createWeb3Modal({ wagmiConfig, projectId: walletConnectProjectId, metadata: metadata }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use prop shorthand here as well
…e in SafeController
…dao/decent-interface into issue/2565-network-config-extended
…tdao/decent-interface into issue/2565-cross-chain-dao-search
…arch `[Issue #2565]` Cross-chain Safe search
Merges with #2595
Discussed in this comment #2595 (comment)
This PR will cover any work needed to ensure that the network is properly being used in the App.