Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STCOR-950 Added
location
to a hook in <MainNav>
to fix comparing …
…old `location` value (#1600) ## Description After the switch to hooks, in [stripes-core/src/components/MainNav/MainNav.js at 3570eea · folio-org/stripes-core](https://github.com/folio-org/stripes-core/blob/3570eea0bca50bb0abb0cc0e52db3ae4bc3a792e/src/components/MainNav/MainNav.js#L46) `location` object is not updated, and so `store.subscribe` callback always uses an old value. When `updateLocation` compares `cleanStateQuery` and `cleanLocationQuery` objects, they are always different because we’re comparing to an old `location` This caused a bug in Inventory, where when a user opens a shared record - the page reloads and user is taken back to search results. This happens because when a user opens a shared record we append `shared=true` to the url. And because `<MainNav>` doesn't compare to a current url the flow gets interrupted. If we add location to the hook’s deps it works as expected. ## Screenshots https://github.com/user-attachments/assets/0973c2ab-c915-4d99-b062-b62c07eb9308 ## Issues [STCOR-950](https://folio-org.atlassian.net/browse/STCOR-950)
- Loading branch information