aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2019-12-13 16:58:29 +0000
committerfeld <feld@feld.me>2019-12-13 16:58:29 +0000
commit0b49e798e0737728e94ff8a284a4570acc7bac28 (patch)
treebfe101ff2213ca145b11f047a039ee4b7d28b2d8 /src/components
parent766a674a488c68a11be925639d7fd2a9242df9ae (diff)
parentd899d06973c7c46e77f9e47f480d6967e83b4adf (diff)
Merge branch 'feature/lockdown-timelines-private-mode' into 'develop'
interaction with BE private mode See merge request pleroma/pleroma-fe!989
Diffstat (limited to 'src/components')
-rw-r--r--src/components/nav_panel/nav_panel.js20
-rw-r--r--src/components/nav_panel/nav_panel.vue4
-rw-r--r--src/components/side_drawer/side_drawer.js6
-rw-r--r--src/components/side_drawer/side_drawer.vue15
4 files changed, 29 insertions, 16 deletions
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index 7f783acb..d9268585 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -1,20 +1,18 @@
+import { mapState } from 'vuex'
+
const NavPanel = {
created () {
if (this.currentUser && this.currentUser.locked) {
this.$store.dispatch('startFetchingFollowRequest')
}
},
- computed: {
- currentUser () {
- return this.$store.state.users.currentUser
- },
- chat () {
- return this.$store.state.chat.channel
- },
- followRequestCount () {
- return this.$store.state.api.followRequests.length
- }
- }
+ computed: mapState({
+ currentUser: state => state.users.currentUser,
+ chat: state => state.chat.channel,
+ followRequestCount: state => state.api.followRequests.length,
+ privateMode: state => state.instance.private,
+ federating: state => state.instance.federating
+ })
}
export default NavPanel
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue
index 4b79b500..034259d9 100644
--- a/src/components/nav_panel/nav_panel.vue
+++ b/src/components/nav_panel/nav_panel.vue
@@ -28,12 +28,12 @@
</span>
</router-link>
</li>
- <li>
+ <li v-if="currentUser || !privateMode">
<router-link :to="{ name: 'public-timeline' }">
<i class="button-icon icon-users" /> {{ $t("nav.public_tl") }}
</router-link>
</li>
- <li>
+ <li v-if="federating && !privateMode">
<router-link :to="{ name: 'public-external-timeline' }">
<i class="button-icon icon-globe" /> {{ $t("nav.twkn") }}
</router-link>
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index 65c96e47..2534eb8f 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -41,6 +41,12 @@ const SideDrawer = {
},
followRequestCount () {
return this.$store.state.api.followRequests.length
+ },
+ privateMode () {
+ return this.$store.state.instance.private
+ },
+ federating () {
+ return this.$store.state.instance.federating
}
},
methods: {
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index 31724fa2..3fba9058 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -79,12 +79,18 @@
</span>
</router-link>
</li>
- <li @click="toggleDrawer">
+ <li
+ v-if="currentUser || !privateMode"
+ @click="toggleDrawer"
+ >
<router-link to="/main/public">
<i class="button-icon icon-users" /> {{ $t("nav.public_tl") }}
</router-link>
</li>
- <li @click="toggleDrawer">
+ <li
+ v-if="federating && !privateMode"
+ @click="toggleDrawer"
+ >
<router-link to="/main/all">
<i class="button-icon icon-globe" /> {{ $t("nav.twkn") }}
</router-link>
@@ -99,7 +105,10 @@
</li>
</ul>
<ul>
- <li @click="toggleDrawer">
+ <li
+ v-if="currentUser || !privateMode"
+ @click="toggleDrawer"
+ >
<router-link :to="{ name: 'search' }">
<i class="button-icon icon-search" /> {{ $t("nav.search") }}
</router-link>