Skip to content

Commit

Permalink
Merge branch '401-update-xef-server-database-to-allow-authentication'…
Browse files Browse the repository at this point in the history
… of github.com:xebia-functional/xef into 401-update-xef-server-database-to-allow-authentication
  • Loading branch information
Montagon committed Sep 12, 2023
2 parents bc294b5 + 081215d commit 040abf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/web/src/state/Settings/SettingsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type Settings = {
type SettingsContextType = [Settings, Dispatch<SetStateAction<Settings>>];

export const initialSettings: Settings = {
apiKey: undefined,
apiKey: sessionStorage.getItem('apiKey') || '',
};

const SettingsContext = createContext<SettingsContextType>([
Expand All @@ -29,6 +29,7 @@ const SettingsProvider = ({children}: { children: ReactNode }) => {

useEffect(() => {
console.info('Settings changed', {...settings});
sessionStorage.setItem('apiKey', settings.apiKey || '');
}, [settings]);

return (
Expand Down

0 comments on commit 040abf6

Please sign in to comment.