Make display of links to public external timeline dependent on restrict_unauthenticated setting (#204) #216

Closed
fedward wants to merge 1 commits from fedward:issue204 into develop
3 changed files with 3 additions and 1 deletions

View File

@ -92,6 +92,7 @@ export default {
editingAvailable () { return this.$store.state.instance.editingAvailable },
layoutType () { return this.$store.state.interface.layoutType },
privateMode () { return this.$store.state.instance.private },
showPublicExternalTimeline () {return currentUser() || !(privateMode || this.$store.state.instance.restrict_unauthenticated.timelines.federated) },
Review

nit: {return => { return
surprised the console didn't scream at you for that

actually it's probably too big to be a oneliner, try this

    showPublicExternalTimeline () {
      if (currentUser() || !privateMode ||
        !this.$store.state.instance.restrict_unauthenticated.timelines.federated) {
        return true
      }
    },
nit: `{return => { return` surprised the console didn't scream at you for that actually it's probably too big to be a oneliner, try this ```js showPublicExternalTimeline () { if (currentUser() || !privateMode || !this.$store.state.instance.restrict_unauthenticated.timelines.federated) { return true } }, ```
reverseLayout () {
const { thirdColumnMode, sidebarRight: reverseSetting } = this.$store.getters.mergedConfig
if (this.layoutType !== 'wide') {

View File

@ -67,6 +67,7 @@
/>
</router-link>
<router-link
v-if="showPublicExternalTimeline"
:to="{ name: 'public-external-timeline' }"
class="nav-icon"
>

View File

@ -48,7 +48,7 @@
>{{ $t("nav.public_tl") }}</span>
</router-link>
</li>
<li v-if="federating && (currentUser || !privateMode)">
<li v-if="federating && showPublicExternalTimeline">
Review

maybe federating should be grouped into this new variable as well?

maybe `federating` should be grouped into this new variable as well?
Review

My goal was the lightest possible change, but I thought about that. But then I also thought that maybe there should be a corresponding variable for the local timeline so the style could be consistent wherever those links appear.

My goal was the lightest possible change, but I thought about that. But then I also thought that maybe there should be a corresponding variable for the local timeline so the style could be consistent wherever those links appear.
Review

well it makes sense for it to be grouped; it wouldn't show if it doesn't federate, so the name is a bit misleading if it's not in there

well it makes sense for it to be grouped; it wouldn't `show` if it doesn't federate, so the name is a bit misleading if it's not in there
<router-link
class="menu-item"
:to="{ name: 'public-external-timeline' }"