forked from AkkomaGang/akkoma-fe
Remove links from navs if we can't see the timeline
This commit is contained in:
parent
1e66217c16
commit
3a8354abb4
7 changed files with 17 additions and 6 deletions
|
@ -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 })
|
||||
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 },
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in a new issue