Don't update url if using default sort

This commit is contained in:
James Grugett 2022-07-29 10:29:36 -07:00
parent 37ad47db99
commit 4ba051726e

View File

@ -120,7 +120,7 @@ export function useQueryAndSortParams(options?: {
// If there's no sort option, then set the one from localstorage // If there's no sort option, then set the one from localstorage
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 && localSort !== defaultSort) {
// Use replace to not break navigating back. // Use replace to not break navigating back.
router.replace( router.replace(
{ query: { ...router.query, s: localSort } }, { query: { ...router.query, s: localSort } },