forked from AkkomaGang/akkoma-fe
simplify code
This commit is contained in:
parent
01aba3f9c6
commit
630c6e3e44
1 changed files with 3 additions and 12 deletions
15
src/main.js
15
src/main.js
|
@ -219,18 +219,9 @@ window.fetch('/nodeinfo/2.0.json')
|
||||||
const metadata = data.metadata
|
const metadata = data.metadata
|
||||||
|
|
||||||
const features = metadata.features
|
const features = metadata.features
|
||||||
store.dispatch('setInstanceOption', {
|
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') })
|
||||||
name: 'mediaProxyAvailable',
|
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
|
||||||
value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0
|
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
|
||||||
})
|
|
||||||
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
|
|
||||||
})
|
|
||||||
|
|
||||||
const suggestions = metadata.suggestions
|
const suggestions = metadata.suggestions
|
||||||
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
||||||
|
|
Loading…
Reference in a new issue