Merge branch 'fix-features-panel' into 'develop'

Fix Features panel

See merge request pleroma/pleroma-fe!366
This commit is contained in:
Henry 2018-10-26 13:53:37 +00:00
commit 2f11ec296e
1 changed files with 5 additions and 3 deletions

View File

@ -217,9 +217,11 @@ window.fetch('/nodeinfo/2.0.json')
.then((res) => res.json())
.then((data) => {
const metadata = data.metadata
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy })
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: data.metadata.chat })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: data.metadata.gopher })
const features = metadata.features
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
const suggestions = metadata.suggestions
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })