@@ -105,10 +105,12 @@ export class MetaStore {
105105 }
106106
107107 public saveTeamsAndGroups ( ) {
108- let yamlStr : string = this . yamlService . stringify ( this . teams ) ;
108+ let yamlStr : string = this . yamlService . stringify ( { teams : this . teams } ) ;
109109 localStorage . setItem ( STORAGE_TEAMS_KEY , yamlStr ) ;
110- yamlStr = this . yamlService . stringify ( this . teamGroups ) ;
110+ console . log ( 'Saved teams to localStorage: ' + yamlStr ) ;
111+ yamlStr = this . yamlService . stringify ( { teamGroups : this . teamGroups } ) ;
111112 localStorage . setItem ( STORAGE_GROUPS_KEY , yamlStr ) ;
113+ console . log ( 'Saved team groups to localStorage: ' + yamlStr ) ;
112114 this . hasLocalStorage = true ;
113115 }
114116
@@ -122,13 +124,13 @@ export class MetaStore {
122124 let storedTeams : string | null = localStorage . getItem ( STORAGE_TEAMS_KEY ) ;
123125 let storedGroups : string | null = localStorage . getItem ( STORAGE_GROUPS_KEY ) ;
124126 try {
125- let metaTeams : TeamNames | null = null ;
126- let metaGroups : TeamGroups | null = null ;
127+ let metaTeams : { teams : TeamNames } | null = null ;
128+ let metaGroups : { teamGroups : TeamGroups } | null = null ;
127129
128130 if ( storedTeams ) metaTeams = this . yamlService . parse ( storedTeams ) ;
129131 if ( storedGroups ) metaGroups = this . yamlService . parse ( storedGroups ) ;
130132
131- this . addMeta ( { teams : metaTeams , teamGroups : metaGroups } ) ;
133+ this . addMeta ( { teams : metaTeams ?. teams , teamGroups : metaGroups ?. teamGroups } ) ;
132134 this . hasLocalStorage = true ;
133135 console . log ( 'Loaded stored meta from localStorage' ) ;
134136 } catch ( error ) {
0 commit comments