diff --git a/server/web/src/state/Settings/SettingsContext.tsx b/server/web/src/state/Settings/SettingsContext.tsx index bcd34fb2b..5a759db84 100644 --- a/server/web/src/state/Settings/SettingsContext.tsx +++ b/server/web/src/state/Settings/SettingsContext.tsx @@ -16,7 +16,7 @@ export type Settings = { type SettingsContextType = [Settings, Dispatch>]; export const initialSettings: Settings = { - apiKey: undefined, + apiKey: sessionStorage.getItem('apiKey') || '', }; const SettingsContext = createContext([ @@ -29,6 +29,7 @@ const SettingsProvider = ({children}: { children: ReactNode }) => { useEffect(() => { console.info('Settings changed', {...settings}); + sessionStorage.setItem('apiKey', settings.apiKey || ''); }, [settings]); return (