wevm / wagmi

Reactive primitives for Ethereum apps
https://wagmi.sh
MIT License
6k stars 1.07k forks source link

Unable to keep selected chainId on page refresh #3743

Closed naward-cs closed 7 months ago

naward-cs commented 7 months ago

Describe the bug

Link between connected and non connected for persisted data invalid. Following setup

when refresh:

It appears the initialstate is leveraging only when wallet is connected (looking at connections only) and not looking at chainId within the intialprops when connections is empty or current:undefined.

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

Wagmi Version

2.5.12

Viem Version

2.8.12

TypeScript Version

5.4.3

Check existing issues

Anything else?

No response

tmm commented 7 months ago

Minimal reproduction required

github-actions[bot] commented 7 months ago

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.