fix logout in App.jsx and update test

This commit is contained in:
John Mitchell
2018-11-06 12:25:36 -05:00
parent 7b099578c8
commit df57b144c4
2 changed files with 15 additions and 3 deletions

View File

@@ -76,6 +76,13 @@ class App extends React.Component {
this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' });
}
onDevLogout = () => {
api.logout()
.then(() => {
this.setState({ activeGroup: 'views_group', activeItem: 'views_group_dashboard' });
});
}
render () {
const { activeItem, activeGroup, isNavOpen } = this.state;
const { logo, loginInfo } = this.props;
@@ -103,7 +110,7 @@ class App extends React.Component {
header={(
<PageHeader
logo={<TowerLogo onClick={this.onLogoClick} />}
avatar={<LogoutButton onDevLogout={api.logout} />}
avatar={<LogoutButton onDevLogout={() => this.onDevLogout()} />}
showNavToggle
onNavToggle={this.onNavToggle}
/>