@@ -38,6 +38,12 @@ import {
3838 setGlobalSetting ,
3939 setPersonalSetting ,
4040} from "~/components/settings/utils/accessors" ;
41+ import {
42+ PERSONAL_KEYS ,
43+ GLOBAL_KEYS ,
44+ LEFT_SIDEBAR_KEYS ,
45+ LEFT_SIDEBAR_SETTINGS_KEYS ,
46+ } from "~/components/settings/utils/settingKeys" ;
4147import type {
4248 LeftSidebarGlobalSettings ,
4349 PersonalSection ,
@@ -138,13 +144,20 @@ const toggleFoldedState = ({
138144 }
139145
140146 if ( isGlobal ) {
141- setGlobalSetting ( [ "Left sidebar" , "Settings" , "Folded" ] , newFolded ) ;
147+ setGlobalSetting (
148+ [
149+ GLOBAL_KEYS . leftSidebar ,
150+ LEFT_SIDEBAR_KEYS . settings ,
151+ LEFT_SIDEBAR_SETTINGS_KEYS . folded ,
152+ ] ,
153+ newFolded ,
154+ ) ;
142155 } else if ( sectionIndex !== undefined ) {
143156 const sections =
144- getPersonalSetting < PersonalSection [ ] > ( [ "Left sidebar" ] ) || [ ] ;
157+ getPersonalSetting < PersonalSection [ ] > ( [ PERSONAL_KEYS . leftSidebar ] ) || [ ] ;
145158 if ( sections [ sectionIndex ] ) {
146159 sections [ sectionIndex ] . Settings . Folded = newFolded ;
147- setPersonalSetting ( [ "Left sidebar" ] , sections ) ;
160+ setPersonalSetting ( [ PERSONAL_KEYS . leftSidebar ] , sections ) ;
148161 }
149162 }
150163} ;
@@ -314,10 +327,10 @@ const GlobalSection = ({ config }: { config: LeftSidebarConfig["global"] }) => {
314327const buildConfig = ( ) : LeftSidebarConfig => {
315328 // Read VALUES from accessor (handles flag routing + mismatch detection)
316329 const globalValues = getGlobalSetting < LeftSidebarGlobalSettings > ( [
317- "Left sidebar" ,
330+ GLOBAL_KEYS . leftSidebar ,
318331 ] ) ;
319332 const personalValues = getPersonalSetting < PersonalSection [ ] > ( [
320- "Left sidebar" ,
333+ PERSONAL_KEYS . leftSidebar ,
321334 ] ) ;
322335
323336 // Read UIDs from old system (needed for fold CRUD during dual-write)
0 commit comments