From 580aae1b545331b284724e54cc31c99e52862f57 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 9 Sep 2018 21:51:40 +0300 Subject: [PATCH] Added more stuff that's actually being added to instanceConfig, simplified the whitelist. --- src/lib/persisted_state.js | 1 + src/main.js | 20 +++----------------- src/modules/instance.js | 11 +++++++++++ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index 007515cd..c9eac91f 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -16,6 +16,7 @@ const saveImmedeatelyActions = [ 'markNotificationsAsSeen', 'clearCurrentUser', 'setCurrentUser', + 'setHighlight', 'setOption' ] diff --git a/src/main.js b/src/main.js index 23bd2cd3..4e7b55bb 100644 --- a/src/main.js +++ b/src/main.js @@ -47,23 +47,7 @@ Vue.use(VueChatScroll) const persistedStateOptions = { paths: [ - 'config.collapseMessageWithSubject', - 'config.hideAttachments', - 'config.hideAttachmentsInConv', - 'config.hideNsfw', - 'config.replyVisibility', - 'config.notificationVisibility', - 'config.autoLoad', - 'config.hoverPreview', - 'config.streaming', - 'config.muteWords', - 'config.customTheme', - 'config.highlight', - 'config.loopVideo', - 'config.loopVideoSilentOnly', - 'config.pauseOnUnfocused', - 'config.stopGifs', - 'config.interfaceLanguage', + 'config', 'users.lastLoginName', 'statuses.notifications.maxSavedId' ] @@ -129,6 +113,8 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setInstanceOption', { name: 'logo', value: logo }) store.dispatch('setInstanceOption', { name: 'logoMask', value: logoMask }) store.dispatch('setInstanceOption', { name: 'logoMargin', value: logoMargin }) + store.dispatch('setInstanceOption', { name: 'redirectRootNoLogin', value: redirectRootNoLogin }) + store.dispatch('setInstanceOption', { name: 'redirectRootLogin', value: redirectRootLogin }) store.dispatch('setInstanceOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) store.dispatch('setInstanceOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) store.dispatch('setInstanceOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled }) diff --git a/src/modules/instance.js b/src/modules/instance.js index 228cee4c..a4fc9651 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -1,6 +1,7 @@ import { set } from 'vue' const defaultState = { + // Stuff from static/config.json and apiConfig name: 'Pleroma FE', registrationOpen: true, textlimit: 5000, @@ -17,9 +18,19 @@ const defaultState = { formattingOptionsEnabled: false, collapseMessageWithSubject: false, disableChat: false, + // Nasty stuff pleromaBackend: true, + emoji: [], customEmoji: [], + + // Feature-set, apparently, not everything here is reported... + mediaProxyAvailable: false, + chatAvailable: false, + gopherAvailable: false, + suggestionsEnabled: false, + suggestionsWeb: '', + // Html stuff instanceSpecificPanelContent: '', tos: ''