Geo-Web-Project / cadastre

Map-based interface for claiming, buying, and managing Geo Web land parcels.
https://geoweb.land/
MIT License
26 stars 15 forks source link

fix: render a different ParcelInfo for every parcel #367

Closed tnrdd closed 1 year ago

tnrdd commented 1 year ago

Description

Pass a key prop to ParcelInfo to tell react to render a different component every time selectedParcelId change instead of rerender the same component with different props and same state, otherwise when the user change the selected parcel the custom hook that returns the parcel content is not triggered until the license owner address is fetched from the subgraph, causing the parcel info panel to show stale data until parcelContent is updated.

Issue

fixes #364

Checklist:

Additional comments

Wait for useBasicProfile to return before showing the parcel name to avoid briefly displaying the fallback info instead of the name when a basic profile is present.

Alert Reviewers

@codynhat @gravenp

codynhat commented 1 year ago

Works great for me now!