File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 88} from 'react' ;
99import { useRouter } from 'next/router' ;
1010import { defaultQuery } from '../config/defaultQuery' ;
11- import { useSearchTabsContext } from './search-tabs-context' ;
11+ import { DEFAULT_TAB_ID , useSearchTabsContext } from './search-tabs-context' ;
1212
1313export type PaginationState = {
1414 from : number ;
@@ -59,7 +59,7 @@ export const PaginationProvider = ({ children }: { children: ReactNode }) => {
5959 const urlFrom = parseInt ( router . query . from as string ) ;
6060 const urlSize = parseInt ( router . query . size as string ) ;
6161 const urlSort = router . query . sort as string ;
62- const urlTab = router . query . tab as string ;
62+ const urlTab = ( router . query . tab || DEFAULT_TAB_ID ) as string ;
6363
6464 if ( ! isNaN ( urlFrom ) && urlTab ) {
6565 setPaginationByTab ( prev => ( {
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ interface SearchContextValue {
1212 setFilters : ( filters : Record < string , string [ ] > ) => void ;
1313}
1414
15+ export const DEFAULT_TAB_ID = tabs . find ( t => t . isDefault ) ?. id || 'd' ;
16+
1517const SearchContext = createContext < SearchContextValue | undefined > ( undefined ) ;
1618
1719/**
You can’t perform that action at this time.
0 commit comments