aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/CONFIGURATION.md3
-rw-r--r--src/App.js3
-rw-r--r--src/App.vue1
-rw-r--r--src/boot/after_store.js3
-rw-r--r--src/components/nav_panel/nav_panel.js21
-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.vue6
8 files changed, 30 insertions, 17 deletions
diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md
index 3a21828b..0a9bbd7a 100644
--- a/docs/CONFIGURATION.md
+++ b/docs/CONFIGURATION.md
@@ -99,3 +99,6 @@ Setting this will change the warning text that is displayed for direct messages.
ATTENTION: If you actually want the behavior to change. You will need to set the appropriate option at the backend. See the backend documentation for information about that.
DO NOT activate this without checking the backend configuration first!
+
+### Private Mode
+If the `private` instance setting is enabled in the backend, features that are not accessible without authentication, such as the timelines and search will be disabled for unauthenticated users.
diff --git a/src/App.js b/src/App.js
index 78ff29da..61b5eec1 100644
--- a/src/App.js
+++ b/src/App.js
@@ -98,7 +98,8 @@ export default {
this.$store.state.instance.instanceSpecificPanelContent
},
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
- isMobileLayout () { return this.$store.state.interface.mobileLayout }
+ isMobileLayout () { return this.$store.state.interface.mobileLayout },
+ privateMode () { return this.$store.state.instance.private }
},
methods: {
scrollToTop () {
diff --git a/src/App.vue b/src/App.vue
index c66df843..d455e9ed 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -44,6 +44,7 @@
class="nav-icon mobile-hidden"
@toggled="onSearchBarToggled"
@click.stop.native
+ v-if="currentUser || !privateMode"
/>
<router-link
class="mobile-hidden"
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index e18cd657..f169d7ba 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -219,6 +219,9 @@ const getNodeInfo = async ({ store }) => {
store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version })
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' })
+ const priv = metadata.private
+ store.dispatch('setInstanceOption', { name: 'private', value: priv })
+
const frontendVersion = window.___pleromafe_commit_hash
store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })
store.dispatch('setInstanceOption', { name: 'tagPolicyAvailable', value: metadata.federation.mrf_policies.includes('TagPolicy') })
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index 7f783acb..dbbfb096 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -1,20 +1,19 @@
+import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
+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.federationPolicy.federating || true
+ })
}
export default NavPanel
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue
index 4b79b500..97c36711 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="(currentUser || !privateMode) && federating">
<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..22cb1a55 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.federationPolicy.federating || true
}
},
methods: {
diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue
index 31724fa2..1454e0d8 100644
--- a/src/components/side_drawer/side_drawer.vue
+++ b/src/components/side_drawer/side_drawer.vue
@@ -79,12 +79,12 @@
</span>
</router-link>
</li>
- <li @click="toggleDrawer">
+ <li @click="toggleDrawer" v-if="currentUser || !privateMode">
<router-link to="/main/public">
<i class="button-icon icon-users" /> {{ $t("nav.public_tl") }}
</router-link>
</li>
- <li @click="toggleDrawer">
+ <li @click="toggleDrawer" v-if="(currentUser || !privateMode) && federating">
<router-link to="/main/all">
<i class="button-icon icon-globe" /> {{ $t("nav.twkn") }}
</router-link>
@@ -99,7 +99,7 @@
</li>
</ul>
<ul>
- <li @click="toggleDrawer">
+ <li @click="toggleDrawer" v-if="currentUser || !privateMode">
<router-link :to="{ name: 'search' }">
<i class="button-icon icon-search" /> {{ $t("nav.search") }}
</router-link>