who to follow panel uses /api/v1/suggestions

This commit is contained in:
Hakaba Hitoyo 2018-08-02 17:57:00 +09:00
parent 32fd108e97
commit bcd499c372
3 changed files with 15 additions and 19 deletions

View file

@ -89,13 +89,10 @@ window.fetch('/api/statusnet/config.json')
window.fetch('/static/config.json')
.then((res) => res.json())
.then((data) => {
const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled} = data
const {theme, background, logo, showInstanceSpecificPanel, scopeOptionsEnabled} = data
store.dispatch('setOption', { name: 'theme', value: theme })
store.dispatch('setOption', { name: 'background', value: background })
store.dispatch('setOption', { name: 'logo', value: logo })
store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel })
store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider })
store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink })
store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled })
if (data['chatDisabled']) {
@ -144,6 +141,14 @@ window.fetch('/static/config.json')
})
})
window.fetch('/nodeinfo/2.0.json')
.then((res) => res.json())
.then((data) => {
const suggestions = data.metadata.suggestions
store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: suggestions.enabled })
store.dispatch('setOption', { name: 'whoToFollowLink', value: suggestions.web })
})
window.fetch('/static/terms-of-service.html')
.then((res) => res.text())
.then((html) => {