From 504d48fc5a707a60f5c7f5d5cf92ab2af762bb2e Mon Sep 17 00:00:00 2001 From: lain Date: Wed, 24 Jun 2020 17:54:35 +0200 Subject: [PATCH] After Store: Remove last statusnet vestiges. --- src/boot/after_store.js | 13 +++++++------ 1 file 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