diff --git a/webapp/src/components/sidebar.tsx b/webapp/src/components/sidebar.tsx index b2b488b67..c4894ccb1 100644 --- a/webapp/src/components/sidebar.tsx +++ b/webapp/src/components/sidebar.tsx @@ -105,15 +105,7 @@ class Sidebar extends React.Component {
{(user) => { - if (user) { - if (user.id === 'single-user') { - return ( -
{intl.formatMessage({id: 'Sidebar.title', defaultMessage: 'Boards'})}
- ) - } - return this.renderUserMenu(user) - } - return
+ return this.renderUserMenu(user) }}
@@ -366,7 +358,7 @@ class Sidebar extends React.Component { this.setState({whiteLogo}) } - private renderUserMenu(user: IUser): JSX.Element { + private renderUserMenu(user?: IUser): JSX.Element { const {intl} = this.props return ( @@ -374,31 +366,33 @@ class Sidebar extends React.Component { {this.state.whiteLogo ? : } - {user.username} - { - octoClient.logout() - window.location.href = '/login' - }} - /> - { - window.location.href = '/change_password' - }} - /> - { - this.setState({showRegistrationLinkDialog: true}) - }} - /> + {user && user.username !== 'single-user' && <> + {user.username} + { + octoClient.logout() + window.location.href = '/login' + }} + /> + { + window.location.href = '/change_password' + }} + /> + { + this.setState({showRegistrationLinkDialog: true}) + }} + /> - + + }