SidebarNavigation: Do not show Bookmarks/Lists links if unauthenticated

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-04-20 19:25:07 +02:00
parent ab5b8f747e
commit 5cecb2ef9e
1 changed files with 50 additions and 48 deletions

View File

@ -28,7 +28,8 @@ const SidebarNavigation = () => {
const makeMenu = (): Menu => {
const menu: Menu = [];
if (account?.locked || followRequestsCount > 0) {
if (account) {
if (account.locked || followRequestsCount > 0) {
menu.push({
to: '/follow_requests',
text: <FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' />,
@ -54,7 +55,7 @@ const SidebarNavigation = () => {
});
}
if (account && instance.invites_enabled) {
if (instance.invites_enabled) {
menu.push({
to: `${baseURL}/invites`,
icon: require('@tabler/icons/icons/mailbox.svg'),
@ -70,7 +71,7 @@ const SidebarNavigation = () => {
});
}
if (account && account.staff) {
if (account.staff) {
menu.push({
to: '/admin',
icon: require('@tabler/icons/icons/dashboard.svg'),
@ -83,6 +84,7 @@ const SidebarNavigation = () => {
if (features.localTimeline || features.publicTimeline) {
menu.push(null);
}
}
if (features.localTimeline) {
menu.push({