Fix #739: Don't show account options as plugin (#745)

This commit is contained in:
Chen-I Lim 2021-07-17 09:01:45 -07:00 committed by GitHub
parent 73225e959b
commit 77a90a473c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -63,13 +63,15 @@ const Sidebar = React.memo((props: Props) => {
)
}
const hasWorkspace = Boolean(workspace && workspace.id !== '0')
return (
<div className='Sidebar octo-sidebar'>
<div className='octo-sidebar-header'>
<div className='heading'>
<SidebarUserMenu
whiteLogo={whiteLogo}
showVersionBadge={Boolean(workspace && workspace.id !== '0')}
showVersionBadge={hasWorkspace}
showAccountActions={!hasWorkspace}
/>
</div>

View File

@ -23,12 +23,13 @@ import './sidebarUserMenu.scss'
type Props = {
whiteLogo: boolean
showVersionBadge: boolean
showAccountActions: boolean
}
const SidebarUserMenu = React.memo((props: Props) => {
const history = useHistory()
const [showRegistrationLinkDialog, setShowRegistrationLinkDialog] = useState(false)
const {whiteLogo, showVersionBadge} = props
const {whiteLogo, showVersionBadge, showAccountActions} = props
const user = useAppSelector<IUser|null>(getCurrentUser)
const intl = useIntl()
return (
@ -48,7 +49,7 @@ const SidebarUserMenu = React.memo((props: Props) => {
</div>
</div>
<Menu>
{user && user.username !== 'single-user' && <>
{showAccountActions && user && user.username !== 'single-user' && <>
<Menu.Label><b>{user.username}</b></Menu.Label>
<Menu.Text
id='logout'