@@ -23,7 +23,7 @@ import {
2323  Loader , 
2424  ScrollArea , 
2525}  from  '@mantine/core' ; 
26- import  {  useDisclosure  }  from  '@mantine/hooks' ; 
26+ import  {  useDisclosure ,   useLocalStorage  }  from  '@mantine/hooks' ; 
2727
2828import  { 
2929  useCreateDashboard , 
@@ -50,7 +50,7 @@ import OnboardingChecklist from './OnboardingChecklist';
5050import  {  useSavedSearches ,  useUpdateSavedSearch  }  from  './savedSearch' ; 
5151import  type  {  SavedSearch ,  ServerDashboard  }  from  './types' ; 
5252import  {  UserPreferencesModal  }  from  './UserPreferencesModal' ; 
53- import  {  useLocalStorage ,   useWindowSize  }  from  './utils' ; 
53+ import  {  useWindowSize  }  from  './utils' ; 
5454
5555import  styles  from  '../styles/AppNav.module.scss' ; 
5656
@@ -212,7 +212,10 @@ const AppNavLinkGroups = <T extends AppNavLinkItem>({
212212} )  =>  { 
213213  const  [ collapsedGroups ,  setCollapsedGroups ]  =  useLocalStorage < 
214214    Record < string ,  boolean > 
215-   > ( `collapsedGroups-${ name }  ,  { } ) ; 
215+   > ( { 
216+     key : `collapsedGroups-${ name }  , 
217+     defaultValue : { } , 
218+   } ) ; 
216219
217220  const  handleToggleGroup  =  useCallback ( 
218221    ( groupName : string )  =>  { 
@@ -375,20 +378,21 @@ export default function AppNav({ fixed = false }: { fixed?: boolean }) {
375378
376379  const  {  data : meData  }  =  api . useMe ( ) ; 
377380
378-   const  [ isSearchExpanded ,  setIsSearchExpanded ]  =  useLocalStorage ( 
379-     'isSearchExpanded' , 
380-     true , 
381-   ) ; 
382-   const  [ isDashboardsExpanded ,  setIsDashboardExpanded ]  =  useLocalStorage ( 
383-     'isDashboardsExpanded' , 
384-     true , 
385-   ) ; 
381+   const  [ isSearchExpanded ,  setIsSearchExpanded ]  =  useLocalStorage < boolean > ( { 
382+     key : 'isSearchExpanded' , 
383+     defaultValue : true , 
384+   } ) ; 
385+   const  [ isDashboardsExpanded ,  setIsDashboardExpanded ]  = 
386+     useLocalStorage < boolean > ( { 
387+       key : 'isDashboardsExpanded' , 
388+       defaultValue : true , 
389+     } ) ; 
386390  const  {  width }  =  useWindowSize ( ) ; 
387391
388-   const  [ isPreferCollapsed ,  setIsPreferCollapsed ]  =  useLocalStorage < boolean > ( 
389-     'isNavCollapsed' , 
390-     false , 
391-   ) ; 
392+   const  [ isPreferCollapsed ,  setIsPreferCollapsed ]  =  useLocalStorage < boolean > ( { 
393+     key :  'isNavCollapsed' , 
394+     defaultValue :  false , 
395+   } ) ; 
392396
393397  const  isSmallScreen  =  ( width  ??  1000 )  <  900 ; 
394398  const  isCollapsed  =  isSmallScreen  ||  isPreferCollapsed ; 
@@ -434,7 +438,10 @@ export default function AppNav({ fixed = false }: { fixed?: boolean }) {
434438  } ) ; 
435439
436440  const  [ isDashboardsPresetsCollapsed ,  setDashboardsPresetsCollapsed ]  = 
437-     useLocalStorage ( 'isDashboardsPresetsCollapsed' ,  false ) ; 
441+     useLocalStorage < boolean > ( { 
442+       key : 'isDashboardsPresetsCollapsed' , 
443+       defaultValue : false , 
444+     } ) ; 
438445
439446  const  savedSearchesResultsRef  =  useRef < HTMLDivElement > ( null ) ; 
440447  const  dashboardsResultsRef  =  useRef < HTMLDivElement > ( null ) ; 
0 commit comments