Add checks for currentUser on sidebar
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
FloatingGhost 2023-03-16 16:41:37 +00:00
parent 9f7f9e2798
commit 7361f4e77e
3 changed files with 10 additions and 3 deletions

View file

@ -32,7 +32,7 @@
>{{ $t("nav.bubble_timeline") }}</span>
</router-link>
</li>
<li v-if="(currentUser || !privateMode) && (publicTimelineVisibility?.local ?? true)">
<li v-if="(currentUser || !privateMode) && (currentUser || (publicTimelineVisibility?.local ?? true))">
<router-link
class="menu-item"
:to="{ name: 'public-timeline' }"
@ -48,7 +48,7 @@
>{{ $t("nav.public_tl") }}</span>
</router-link>
</li>
<li v-if="federating && (currentUser || !privateMode) && (publicTimelineVisibility?.federated ?? true)">
<li v-if="federating && (currentUser || !privateMode) && (currentUser || (publicTimelineVisibility?.federated ?? true))">
<router-link
class="menu-item"
:to="{ name: 'public-external-timeline' }"

View file

@ -4,6 +4,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChevronDown
} from '@fortawesome/free-solid-svg-icons'
import { mapState } from 'vuex'
library.add(faChevronDown)
@ -41,7 +42,11 @@ const TimelineMenuTabs = {
},
privateMode () {
return this.$store.state.instance.private
}
},
...mapState({
currentUser: state => state.users.currentUser,
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
})
},
methods: {
timelineName () {

View file

@ -18,6 +18,7 @@
<router-link
:to="{ name: 'public-timeline' }"
class="nav-icon"
v-if="currentUser || (publicTimelineVisibility?.local ?? true)"
>
<FAIcon
fixed-width
@ -41,6 +42,7 @@
<router-link
:to="{ name: 'public-external-timeline' }"
class="nav-icon"
v-if="currentUser || (publicTimelineVisibility?.federated ?? true)"
>
<FAIcon
fixed-width