Merge branch 'feature/configurable-default-path' into 'develop'

Feature/configurable default path

See merge request pleroma/pleroma-fe!173
This commit is contained in:
Shpuld Shpludson 2017-11-22 19:24:16 +00:00
commit 222b0aa982
2 changed files with 38 additions and 36 deletions

View File

@ -63,8 +63,24 @@ const store = new Vuex.Store({
strict: process.env.NODE_ENV !== 'production'
})
const i18n = new VueI18n({
locale: currentLocale,
fallbackLocale: 'en',
messages
})
window.fetch('/static/config.json')
.then((res) => res.json())
.then((data) => {
const {name, theme, background, logo, registrationOpen} = data
store.dispatch('setOption', { name: 'name', value: name })
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: 'registrationOpen', value: registrationOpen })
const routes = [
{ name: 'root', path: '/', redirect: '/main/all' },
{ name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' },
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
{ path: '/main/friends', component: FriendsTimeline },
@ -88,12 +104,6 @@ const router = new VueRouter({
}
})
const i18n = new VueI18n({
locale: currentLocale,
fallbackLocale: 'en',
messages
})
/* eslint-disable no-new */
new Vue({
router,
@ -102,15 +112,6 @@ new Vue({
el: '#app',
render: h => h(App)
})
window.fetch('/static/config.json')
.then((res) => res.json())
.then(({name, theme, background, logo, registrationOpen}) => {
store.dispatch('setOption', { name: 'name', value: name })
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: 'registrationOpen', value: registrationOpen })
})
window.fetch('/static/terms-of-service.html')

View File

@ -3,5 +3,6 @@
"theme": "pleroma-dark",
"background": "/static/bg.jpg",
"logo": "/static/logo.png",
"registrationOpen": false
"registrationOpen": false,
"defaultPath": "/main/all"
}