mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-14 12:34:46 +00:00
adapt to destructive change of api
This commit is contained in:
parent
20e4ec4979
commit
01aba3f9c6
1 changed files with 14 additions and 3 deletions
17
src/main.js
17
src/main.js
|
@ -217,9 +217,20 @@ 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.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
|
||||
})
|
||||
|
||||
const suggestions = metadata.suggestions
|
||||
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
||||
|
|
Loading…
Reference in a new issue