@@ -2,6 +2,7 @@ import { callAthena, ParamValue } from '../../api/athena'
22import { BackButton } from '../../components/BackButton'
33import { TopAppBar } from '../../components/TopAppBar'
44import { useAsyncMemo , useRouteParams } from '../../utils/hooks'
5+ import { useStorage } from '../../utils/storage'
56import { SettingCategory , SettingDefinition , SETTINGS } from './settings'
67import { Button } from '../../components/Button'
78import { Toggle } from '../../components/Toggle'
@@ -465,7 +466,7 @@ export const Component = () => {
465466 const [ changes , setChanges ] = useState < Record < string , string > > ( { } )
466467 const [ saving , setSaving ] = useState ( false )
467468 const [ savedValues , setSavedValues ] = useState < Record < string , string > > ( { } )
468- const [ openSection , setOpenSection ] = useState < SettingCategory | null > ( 'models ')
469+ const [ openSection , setOpenSection ] = useStorage ( 'togglesOpenTab ')
469470
470471 const res = useAsyncMemo ( ( ) => callAthena ( { type : 'getAllParams' , dongleId, params : { } } ) , [ dongleId ] )
471472
@@ -525,7 +526,7 @@ export const Component = () => {
525526 setSaving ( false )
526527 }
527528
528- const toggleSection = ( cat : SettingCategory ) => setOpenSection ( ( prev ) => ( prev === cat ? null : cat ) )
529+ const toggleSection = ( cat : SettingCategory ) => setOpenSection ( openSection === cat ? null : cat )
529530
530531 const changeCount = Object . keys ( changes ) . length
531532 const isLoading = res === undefined
0 commit comments