diff --git a/frontend/src/components/TableView/TableView.tsx b/frontend/src/components/TableView/TableView.tsx index 50df4288..f724d5ba 100755 --- a/frontend/src/components/TableView/TableView.tsx +++ b/frontend/src/components/TableView/TableView.tsx @@ -419,7 +419,11 @@ export const TableView = ({ ) } - const buildTableStateUrl = () => `${location.pathname}?${TABLE_STATE_URL_PARAM}=${encodeURIComponent(tableStateId)}` + const buildTableStateUrl = () => { + const params = new URLSearchParams(location.search) + params.set(TABLE_STATE_URL_PARAM, tableStateId) + return `${location.pathname}?${params.toString()}` + } const loadStateFromUrl = ( state: TableStateInUrl, diff --git a/frontend/src/hooks/useSyncTabSearch.ts b/frontend/src/hooks/useSyncTabSearch.ts index 7c3d863e..d2e35097 100644 --- a/frontend/src/hooks/useSyncTabSearch.ts +++ b/frontend/src/hooks/useSyncTabSearch.ts @@ -18,15 +18,13 @@ export const useSyncTabSearch = (tab: number) => { }, [location.key, location.state]) useEffect(() => { - const nextSearch = `?tab=${tab}` - if (location.search === nextSearch) { - return - } + const params = new URLSearchParams(location.search) + if (params.get('tab') === String(tab)) return navigate( { pathname: location.pathname, - search: nextSearch, + search: `?tab=${tab}`, }, { replace: true,