Skip to content

Commit

Permalink
♻️ Ignore logout function on header unit
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltomasik committed Aug 24, 2018
1 parent 323dc82 commit 88aa466
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ import Options from '../dialog/options';
import routes from './../../constants/routes';

class Header extends React.Component {
/* istanbul ignore next */
logOut() {
this.props.logOut();
this.props.closeDialog();
this.props.history.replace(`${routes.dashboard.path}`);
}

shouldShowActionButton() {
const { pathname } = this.props.location;
return !this.props.isAuthenticated
Expand Down Expand Up @@ -44,11 +51,7 @@ class Header extends React.Component {
},
secondButton: {
text: this.props.t('Logout'),
onClickHandler: () => {
this.props.logOut();
this.props.closeDialog();
this.props.history.replace(`${routes.dashboard.path}`);
},
onClickHandler: this.logOut.bind(this),
},
},
});
Expand Down

0 comments on commit 88aa466

Please sign in to comment.