diff --git a/apps/explorer/src/components/orders/OrderDetails/FillsTableWithData.tsx b/apps/explorer/src/components/orders/OrderDetails/FillsTableWithData.tsx index 920a3a43b8..cd4fa093ff 100644 --- a/apps/explorer/src/components/orders/OrderDetails/FillsTableWithData.tsx +++ b/apps/explorer/src/components/orders/OrderDetails/FillsTableWithData.tsx @@ -21,7 +21,7 @@ export const FillsTableWithData: React.FC = ({ areTokensLoaded, order, is const { data: trades, tableState } = useContext(FillsTableContext) const isFirstRender = useFirstRender() - return isFirstRender || !areTokensLoaded ? ( + return isFirstRender && !areTokensLoaded ? ( ) : ( = (props) => { return (): void => clearTimeout(timer) }) - const onChangeTab = useCallback((tabId: number) => { - const newTabViewName = TabView[tabId] - if (!newTabViewName) return + const onChangeTab = useCallback( + (tabId: number) => { + const newTabViewName = TabView[tabId] + if (!newTabViewName) return - setTabViewSelected(TabView[newTabViewName]) - }, []) - - useEffect( - () => updateQueryString(TAB_QUERY_PARAM_KEY, TabView[tabViewSelected].toLowerCase()), - [tabViewSelected, updateQueryString], + updateQueryString(TAB_QUERY_PARAM_KEY, newTabViewName.toLowerCase()) + setTabViewSelected(TabView[newTabViewName]) + }, + [updateQueryString], ) + const location = useLocation() + useEffect(() => { + setTabViewSelected(TabView[tab]) + }, [location, tab]) + if (!chainId) { return null } diff --git a/apps/explorer/src/hooks/useQuery.ts b/apps/explorer/src/hooks/useQuery.ts index 80a9c01dc0..d20ed00e0d 100644 --- a/apps/explorer/src/hooks/useQuery.ts +++ b/apps/explorer/src/hooks/useQuery.ts @@ -26,7 +26,7 @@ export function useUpdateQueryString(): (key: string, value: string) => void { (key: string, value: string) => { query.set(key, value) - navigate({ search: query.toString() }, { replace: true }) + navigate({ search: query.toString() }) }, [navigate, query] )