forked from AkkomaGang/akkoma-fe
update
This commit is contained in:
parent
95e6bccec5
commit
dfc5f170c6
1 changed files with 67 additions and 51 deletions
26
src/main.js
26
src/main.js
|
@ -93,10 +93,27 @@ window.fetch('/api/statusnet/config.json')
|
|||
store.dispatch('setOption', { name: 'server', value: server })
|
||||
})
|
||||
|
||||
window.fetch('/static/config.json')
|
||||
window.fetch('/api/statusnet/config.json')
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled, collapseMessageWithSubject} = data
|
||||
var apiStatusnetConfigSitePleromafe = data.site.pleromafe
|
||||
window.fetch('/static/sonfig.json')
|
||||
.then((data) => {
|
||||
var staticConfig = data
|
||||
|
||||
var theme = (apiStatusnetConfigSitePleromafe.theme || staticConfig.theme)
|
||||
var background = (apiStatusnetConfigSitePleromafe.background || staticConfig.background)
|
||||
var logo = (apiStatusnetConfigSitePleromafe.logo || staticConfig.logo)
|
||||
var redirectRootNoLogin = (apiStatusnetConfigSitePleromafe.redirectRootNoLogin || staticConfig.redirectRootNoLogin)
|
||||
var redirectRootLogin = (apiStatusnetConfigSitePleromafe.redirectRootLogin || staticConfig.redirectRootLogin)
|
||||
var chatDisabled = (apiStatusnetConfigSitePleromafe.chatDisabled || staticConfig.chatDisabled)
|
||||
var showWhoToFollowPanel = (apiStatusnetConfigSitePleromafe.showWhoToFollowPanel || staticConfig.showWhoToFollowPanel)
|
||||
var whoToFollowProvider = (apiStatusnetConfigSitePleromafe.whoToFollowProvider || staticConfig.whoToFollowProvider)
|
||||
var whoToFollowLink = (apiStatusnetConfigSitePleromafe.whoToFollowLink || staticConfig.whoToFollowLink)
|
||||
var showInstanceSpecificPanel = (apiStatusnetConfigSitePleromafe.showInstanceSpecificPanel || staticConfig.showInstanceSpecificPanel)
|
||||
var scopeOptionsEnabled = (apiStatusnetConfigSitePleromafe.scopeOptionsEnabled || staticConfig.scopeOptionsEnabled)
|
||||
var collapseMessageWithSubject = (apiStatusnetConfigSitePleromafe.collapseMessageWithSubject || staticConfig.collapseMessageWithSubject)
|
||||
|
||||
store.dispatch('setOption', { name: 'theme', value: theme })
|
||||
store.dispatch('setOption', { name: 'background', value: background })
|
||||
store.dispatch('setOption', { name: 'logo', value: logo })
|
||||
|
@ -106,7 +123,7 @@ window.fetch('/static/config.json')
|
|||
store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
|
||||
store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled })
|
||||
store.dispatch('setOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject })
|
||||
if (data['chatDisabled']) {
|
||||
if (chatDisabled) {
|
||||
store.dispatch('disableChat')
|
||||
}
|
||||
|
||||
|
@ -114,8 +131,6 @@ window.fetch('/static/config.json')
|
|||
{ name: 'root',
|
||||
path: '/',
|
||||
redirect: to => {
|
||||
var redirectRootLogin = data['redirectRootLogin']
|
||||
var redirectRootNoLogin = data['redirectRootNoLogin']
|
||||
return (store.state.users.currentUser ? redirectRootLogin : redirectRootNoLogin) || '/main/all'
|
||||
}},
|
||||
{ path: '/main/all', component: PublicAndExternalTimeline },
|
||||
|
@ -152,6 +167,7 @@ window.fetch('/static/config.json')
|
|||
render: h => h(App)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
window.fetch('/static/terms-of-service.html')
|
||||
.then((res) => res.text())
|
||||
|
|
Loading…
Reference in a new issue