add timeline visibility setting parsing

This commit is contained in:
FloatingGhost 2023-03-18 20:01:05 +00:00
parent 7361f4e77e
commit b92b2f74a4
9 changed files with 17 additions and 9 deletions

View file

@ -323,6 +323,7 @@ const getNodeInfo = async ({ store }) => {
})
store.dispatch('setInstanceOption', { name: 'publicTimelineVisibility', value: metadata.publicTimelineVisibility })
store.dispatch('setInstanceOption', { name: 'federatedTimelineAvailable', value: metadata.federatedTimelineAvailable })
const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })

View file

@ -107,6 +107,7 @@ export default {
},
...mapState({
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
federatedTimelineAvailable: state => state.instance.federatedTimelineAvailable,
})
},
methods: {

View file

@ -56,7 +56,7 @@
/>
</router-link>
<router-link
v-if="currentUser && showBubbleTimeline"
v-if="(currentUser || publicTimelineVisibility?.bubble) && showBubbleTimeline"
:to="{ name: 'bubble-timeline' }"
class="nav-icon"
>
@ -70,7 +70,7 @@
<router-link
:to="{ name: 'public-external-timeline' }"
class="nav-icon"
v-if="(currentUser || (publicTimelineVisibility?.federated ?? true))"
v-if="federatedTimelineAvailable && (currentUser || (publicTimelineVisibility?.federated ?? true))"
>
<FAIcon
fixed-width

View file

@ -26,6 +26,7 @@ const TimelineMenuContent = {
federating: state => state.instance.federating,
showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0),
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
federatedTimelineAvailable: state => state.instance.federatedTimelineAvailable,
})
}
}

View file

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

View file

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

View file

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

View file

@ -46,6 +46,8 @@ const TimelineMenuTabs = {
...mapState({
currentUser: state => state.users.currentUser,
publicTimelineVisibility: state => state.instance.publicTimelineVisibility,
federatedTimelineAvailable: state => state.instance.federatedTimelineAvailable,
showBubbleTimeline: state => (state.instance.localBubbleInstances.length > 0),
})
},
methods: {

View file

@ -28,7 +28,7 @@
/>
</router-link>
<router-link
v-if="currentUser"
v-if="(currentUser || publicTimelineVisibility?.bubble) && showBubbleTimeline"
:to="{ name: 'bubble-timeline' }"
class="nav-icon"
>
@ -42,7 +42,7 @@
<router-link
:to="{ name: 'public-external-timeline' }"
class="nav-icon"
v-if="currentUser || (publicTimelineVisibility?.federated ?? true)"
v-if="(currentUser || (publicTimelineVisibility?.federated ?? true)) && federatedTimelineAvailable"
>
<FAIcon
fixed-width