From e2248bcf4fc57b7dbac9585a41b0578201394d88 Mon Sep 17 00:00:00 2001 From: dtluna Date: Fri, 9 Feb 2018 16:02:26 +0300 Subject: Use `name` and `closed` from the backend --- src/main.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index a14ca7c8..8d598d78 100644 --- a/src/main.js +++ b/src/main.js @@ -75,15 +75,22 @@ const i18n = new VueI18n({ messages }) -window.fetch('/static/config.json') +window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - const {name, theme, background, logo, registrationOpen} = 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') + .then((res) => res.json()) + .then((data) => { + const {theme, background, logo} = 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: 'registrationOpen', value: registrationOpen }) if (data['chatDisabled']) { store.dispatch('disableChat') } -- cgit v1.2.3-70-g09d2 From e49cf7b67a3d1532ff19091697c4d2487e14d257 Mon Sep 17 00:00:00 2001 From: dtluna Date: Fri, 9 Feb 2018 16:37:32 +0300 Subject: Add textlimit --- src/main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index 8d598d78..7fb9a047 100644 --- a/src/main.js +++ b/src/main.js @@ -78,9 +78,10 @@ const i18n = new VueI18n({ window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - const {name, closed: registrationClosed, textlimit} = data + const {name, closed: registrationClosed, textlimit} = data.site + store.dispatch('setOption', { name: 'name', value: name }) - store.dispatch('setOption', { name: 'registrationOpen', value: !registrationClosed }) + store.dispatch('setOption', { name: 'registrationOpen', value: (registrationClosed === '0') }) store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) }) }) -- cgit v1.2.3-70-g09d2