Remove links from navs if we can't see the timeline
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
FloatingGhost 2023-03-15 22:20:54 +00:00
parent 6fdef479d0
commit 42ab3eada4
7 changed files with 17 additions and 6 deletions

View file

@ -322,6 +322,8 @@ const getNodeInfo = async ({ store }) => {
: federation.enabled
})
store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility })
const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })

View file

@ -19,6 +19,7 @@ import {
faInfoCircle,
faUserTie
} from '@fortawesome/free-solid-svg-icons'
import { mapState } from 'vuex'
library.add(
faSignInAlt,
@ -103,7 +104,10 @@ export default {
},
showBubbleTimeline () {
return this.$store.state.instance.localBubbleInstances.length > 0
}
},
...mapState({
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
})
},
methods: {
scrollToTop () {

View file

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

View file

@ -15,6 +15,7 @@ import {
faBookmark as faBookmarkReg,
faFlag
} from '@fortawesome/free-regular-svg-icons'
import { mapState } from 'vuex'
library.add(
faEllipsisH,
@ -191,7 +192,7 @@ const ExtraButtons = {
isEdited () {
return this.status.edited_at !== null
},
editingAvailable () { return this.$store.state.instance.editingAvailable }
editingAvailable () { return this.$store.state.instance.editingAvailable },
}
}

View file

@ -50,7 +50,7 @@ const NavPanel = {
...mapState({
currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private,
federating: state => state.instance.federating
federating: state => state.instance.federating,
}),
...mapGetters(['unreadAnnouncementCount']),
followRequestCount () {

View file

@ -24,7 +24,8 @@ const TimelineMenuContent = {
currentUser: state => state.users.currentUser,
privateMode: state => state.instance.private,
federating: state => state.instance.federating,
showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0)
showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0),
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
})
}
}

View file

@ -32,7 +32,7 @@
>{{ $t("nav.bubble_timeline") }}</span>
</router-link>
</li>
<li v-if="currentUser || !privateMode">
<li v-if="(currentUser || !privateMode) && (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)">
<li v-if="federating && (currentUser || !privateMode) && (publicTimelineVisibility?.federated ?? true)">
<router-link
class="menu-item"
:to="{ name: 'public-external-timeline' }"
@ -62,6 +62,7 @@
:title="$t('nav.twkn_timeline_description')"
:aria-label="$t('nav.twkn_timeline_description')"
>{{ $t("nav.twkn") }}</span>
</router-link>
</li>
<li v-if="currentUser">