diff options
| author | lain <lain@soykaf.club> | 2020-06-24 17:54:35 +0200 |
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-06-24 17:54:35 +0200 |
| commit | 504d48fc5a707a60f5c7f5d5cf92ab2af762bb2e (patch) | |
| tree | cd779c1bb14f03532e7e72965ab8d79d6e258346 /src/boot | |
| parent | 143da55c56a932e4e88b4959511c59f1d73d37b9 (diff) | |
After Store: Remove last statusnet vestiges.
Diffstat (limited to 'src/boot')
| -rw-r--r-- | src/boot/after_store.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 5213fbbd..2398c43c 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -8,14 +8,15 @@ import backendInteractorService from '../services/backend_interactor_service/bac import { CURRENT_VERSION } from '../services/theme_data/theme_data.service.js' import { applyTheme } from '../services/style_setter/style_setter.js' -const getStatusnetConfig = async ({ store }) => { +const getInstanceConfig = async ({ store }) => { try { - const res = await window.fetch('/api/statusnet/config.json') + const res = await window.fetch('/api/v1/instance') if (res.ok) { const data = await res.json() - const { textlimit, vapidPublicKey } = data.site + const textlimit = data.max_toot_chars + const vapidPublicKey = data.pleroma.vapid_public_key - store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) }) + store.dispatch('setInstanceOption', { name: 'textlimit', value: textlimit }) if (vapidPublicKey) { store.dispatch('setInstanceOption', { name: 'vapidPublicKey', value: vapidPublicKey }) @@ -24,7 +25,7 @@ const getStatusnetConfig = async ({ store }) => { throw (res) } } catch (error) { - console.error('Could not load statusnet config, potentially fatal') + console.error('Could not load instance config, potentially fatal') console.error(error) } } @@ -319,7 +320,7 @@ const afterStoreSetup = async ({ store, i18n }) => { getInstancePanel({ store }), getStickers({ store }), getNodeInfo({ store }), - getStatusnetConfig({ store }) + getInstanceConfig({ store }) ]) // Start fetching things that don't need to block the UI |
