Fix not being able to go back on markets pages / communities

This commit is contained in:
James Grugett 2022-03-23 00:34:04 -05:00
parent a967f7459d
commit 8569a0362b

View File

@ -69,7 +69,9 @@ export function useQueryAndSortParams(options?: {
if (router.isReady && !sort && shouldLoadFromStorage) { if (router.isReady && !sort && shouldLoadFromStorage) {
const localSort = localStorage.getItem(MARKETS_SORT) as Sort const localSort = localStorage.getItem(MARKETS_SORT) as Sort
if (localSort) { if (localSort) {
setSort(localSort) router.query.s = localSort
// Use replace to not break navigating back.
router.replace(router, undefined, { shallow: true })
} }
} }
}) })