Skip to content
Snippets Groups Projects
Commit 630c6e3e authored by hakabahitoyo's avatar hakabahitoyo
Browse files

simplify code

parent 01aba3f9
No related branches found
No related tags found
No related merge requests found
......@@ -219,18 +219,9 @@ window.fetch('/nodeinfo/2.0.json')
const metadata = data.metadata
const features = metadata.features
store.dispatch('setInstanceOption', {
name: 'mediaProxyAvailable',
value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0
})
store.dispatch('setInstanceOption', {
name: 'chatAvailable',
value: features.findIndex((element, index, array) => (element === 'chat')) >= 0
})
store.dispatch('setInstanceOption', {
name: 'gopherAvailable',
value: features.findIndex((element, index, array) => (element === 'gopher')) >= 0
})
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 })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment