diff --git a/src/App.jsx b/src/App.jsx index 6646f6e93e..1ca052bd0e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -79,10 +79,6 @@ class App extends React.Component { }; } - getSessionObject(key) { - return JSON.parse(sessionStorage.getItem(key) || '{}'); - } - onNavToggle = () => { this.setState(({ isNavOpen }) => ({ isNavOpen: !isNavOpen })); }; @@ -94,20 +90,15 @@ class App extends React.Component { onDevLogout = async () => { await api.get(API_LOGOUT); this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' }); - if (sessionStorage.config) { - sessionStorage.clear(); - } } async componentDidMount() { - // Grab our config data from the API and store in sessionStorage - if (!sessionStorage.config) { - const { data } = await api.get(API_CONFIG); - sessionStorage.setItem('config', JSON.stringify(data)); - } + // Grab our config data from the API and store in state + const { data } = await api.get(API_CONFIG); + this.setState({ config: data }); } render() { - const { isNavOpen } = this.state; + const { isNavOpen, config } = this.state; const { logo, loginInfo, history } = this.props; const PageToolbar = ( @@ -235,7 +226,7 @@ class App extends React.Component { !api.isAuthenticated()} redirectPath="/login" path="/projects" component={Projects} /> !api.isAuthenticated()} redirectPath="/login" path="/inventories" component={Inventories} /> !api.isAuthenticated()} redirectPath="/login" path="/inventory_scripts" component={InventoryScripts} /> - + !api.isAuthenticated()} redirectPath="/login" path="/organizations" component={Organizations} /> !api.isAuthenticated()} redirectPath="/login" path="/users" component={Users} />