forked from AkkomaGang/akkoma-fe
Use name
and closed
from the backend
This commit is contained in:
parent
082a119fd7
commit
e2248bcf4f
2 changed files with 10 additions and 5 deletions
13
src/main.js
13
src/main.js
|
@ -75,15 +75,22 @@ const i18n = new VueI18n({
|
||||||
messages
|
messages
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.fetch('/api/statusnet/config.json')
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((data) => {
|
||||||
|
const {name, closed: registrationClosed, textlimit} = data
|
||||||
|
store.dispatch('setOption', { name: 'name', value: name })
|
||||||
|
store.dispatch('setOption', { name: 'registrationOpen', value: !registrationClosed })
|
||||||
|
store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) })
|
||||||
|
})
|
||||||
|
|
||||||
window.fetch('/static/config.json')
|
window.fetch('/static/config.json')
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const {name, theme, background, logo, registrationOpen} = data
|
const {theme, background, logo} = data
|
||||||
store.dispatch('setOption', { name: 'name', value: name })
|
|
||||||
store.dispatch('setOption', { name: 'theme', value: theme })
|
store.dispatch('setOption', { name: 'theme', value: theme })
|
||||||
store.dispatch('setOption', { name: 'background', value: background })
|
store.dispatch('setOption', { name: 'background', value: background })
|
||||||
store.dispatch('setOption', { name: 'logo', value: logo })
|
store.dispatch('setOption', { name: 'logo', value: logo })
|
||||||
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
|
|
||||||
if (data['chatDisabled']) {
|
if (data['chatDisabled']) {
|
||||||
store.dispatch('disableChat')
|
store.dispatch('disableChat')
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Pleroma FE",
|
|
||||||
"theme": "pleroma-dark",
|
"theme": "pleroma-dark",
|
||||||
"background": "/static/bg.jpg",
|
"background": "/static/bg.jpg",
|
||||||
"logo": "/static/logo.png",
|
"logo": "/static/logo.png",
|
||||||
"registrationOpen": false,
|
|
||||||
"defaultPath": "/main/all",
|
"defaultPath": "/main/all",
|
||||||
"chatDisabled": false
|
"chatDisabled": false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue