ourzora / nouns-builder

Nouns Builder
https://nouns.build
MIT License
93 stars 45 forks source link

fix useContractReads state dumping #393

Closed jordanlesich closed 1 year ago

jordanlesich commented 1 year ago

Description

Adds keepPreviousData : true to useContractReads to useVotes hook and ProposalActions

Motivation & context

wagmi useContractReads hook was forcing page re-renders due to a bug with state/caching persistence

https://github.com/wagmi-dev/wagmi/issues/2878

Took a bit of digging, but I was able to find a parameter that would stop this from happening

keepPreviousData : true

This solves both issues: 1) Proposal description and title being deleted on first login on network switch 2) Vote modal closing and deleting vote reason data on vote page.

Code review

Type of change

Checklist

vercel[bot] commented 1 year ago

@jordanlesich is attempting to deploy a commit to the Nouns Builder Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] commented 1 year ago

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

Name Status Preview Updated (UTC)
nouns-builder ✅ Ready (Inspect) Visit Preview Oct 23, 2023 2:11am
testnet-nouns-builder ✅ Ready (Inspect) Visit Preview Oct 23, 2023 2:11am