aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHakaba Hitoyo <hakabahitoyo@example.com>2018-09-04 10:44:25 +0900
committerHakaba Hitoyo <hakabahitoyo@example.com>2018-09-04 10:44:25 +0900
commit65115bfc7f991b9203724eab67f73a34259cf6b2 (patch)
tree2b5ad5d3c5580dc2175b54dd1881bd340f105e87 /src
parentfa477dd41f78e17bb844342aa770ac8854fe3310 (diff)
features panes supports chat & gopher
Diffstat (limited to 'src')
-rw-r--r--src/components/features_panel/features_panel.js6
-rw-r--r--src/components/features_panel/features_panel.vue4
-rw-r--r--src/main.js9
3 files changed, 14 insertions, 5 deletions
diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js
index 75a671f2..21d78e19 100644
--- a/src/components/features_panel/features_panel.js
+++ b/src/components/features_panel/features_panel.js
@@ -1,7 +1,11 @@
const FeaturesPanel = {
computed: {
- mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable },
+ chat: function () {
+ return this.$store.state.config.chatAvailable && (!this.$store.state.chatDisabled)
+ },
+ gopher: function () { return this.$store.state.config.gopherAvailable },
whoToFollow: function () { return this.$store.state.config.suggestionsEnabled },
+ mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable },
scopeOptions: function () { return this.$store.state.config.scopeOptionsEnabled },
formattingOptions: function () { return this.$store.state.config.formattingOptionsEnabled },
textlimit: function () { return this.$store.state.config.textlimit }
diff --git a/src/components/features_panel/features_panel.vue b/src/components/features_panel/features_panel.vue
index 5ec4d255..5c532f1a 100644
--- a/src/components/features_panel/features_panel.vue
+++ b/src/components/features_panel/features_panel.vue
@@ -8,8 +8,10 @@
</div>
<div class="panel-body features-panel">
<ul>
- <li v-if="mediaProxy">Media proxy</li>
+ <li v-if="chat">Chat</li>
+ <li v-if="gopher">Gopher</li>
<li v-if="whoToFollow">Who to follow</li>
+ <li v-if="mediaProxy">Media proxy</li>
<li v-if="scopeOptions">Scope options</li>
<li v-if="formattingOptions">Formatting options</li>
<li>Text limit = {{textlimit}}</li>
diff --git a/src/main.js b/src/main.js
index 64b223aa..58f520db 100644
--- a/src/main.js
+++ b/src/main.js
@@ -222,9 +222,12 @@ window.fetch('/instance/panel.html')
window.fetch('/nodeinfo/2.0.json')
.then((res) => res.json())
.then((data) => {
- const suggestions = data.metadata.suggestions
+ const metadata = data.metadata
+ store.dispatch('setOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy })
+ store.dispatch('setOption', { name: 'chatAvailable', value: data.metadata.chat })
+ store.dispatch('setOption', { name: 'gopherAvailable', value: data.metadata.gopher })
+
+ const suggestions = metadata.suggestions
store.dispatch('setOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
store.dispatch('setOption', { name: 'suggestionsWeb', value: suggestions.web })
-
- store.dispatch('setOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy })
})