Return default navbar state when there is no local storage value set

This commit is contained in:
Saketh Varma 2025-05-05 12:08:33 -05:00
parent 2e3328fce0
commit ab21d1f964

View File

@ -22,7 +22,9 @@ export type LocalState = {
* Loads a persisted object from the local browser storage.
*/
const loadLocalState = () => {
return JSON.parse(localStorage.getItem(LOCAL_STATE_KEY) || '{}') as LocalState;
return JSON.parse(
localStorage.getItem(LOCAL_STATE_KEY) || `{"state" : ${NavBarStateType.Collapsed}}`,
) as LocalState;
};
/**