Add checks for currentUser on sidebar

This commit is contained in:
FloatingGhost 2023-03-16 16:41:37 +00:00 committed by hynet-mel
parent 6b4680bf37
commit 0f4cdcda48
3 changed files with 10 additions and 3 deletions

View file

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

View file

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

View file

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