Navigate to home not always working correctly
Closed this issue · 1 comments
joepio commented
I've noticed a bug in production a few times that I haven't been able to reproduce in development for some time. Sometimes when navigating to the root (the homepage) of a server, the wrong page shows up.
- The address bars (both of the browser and atomic-data-browser) show the correct URL
- The ResourcePage shows the wrong resource, mostly one that was visible a few clicks ago
E.g. here we've visited Home, but we still see the Document Edit
invite, which was visited a couple of clicks before:
joepio commented
I think it was this line in the routes:
<Route path='/' element={<ResourcePage subject={removeTrailingSlash(window.location.href)} />} />
This was called whenever AppRoutes
was rerendered. And that is not the right time!