From a1cde6ce0fcc73f2545ca8aab8ece77ba6723189 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 24 Mar 2026 14:37:51 +0200 Subject: [PATCH] renamed identity stuff to be more clear --- src/boot/after_store.js | 4 ++-- src/modules/default_config_state.js | 5 ++--- src/stores/instance.js | 5 ++--- src/stores/interface.js | 18 ++++++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index fe21eb442..0cf25ce5d 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -40,7 +40,7 @@ import { useUserHighlightStore } from 'src/stores/user_highlight.js' import VBodyScrollLock from 'src/directives/body_scroll_lock' import { instanceDefaultConfig, - staticOrApiConfigDefault, + instanceIdentityDefault, } from 'src/modules/default_config_state.js' let staticInitialResults = null @@ -175,7 +175,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { } } - Object.keys(staticOrApiConfigDefault) + Object.keys(instanceIdentityDefault) .map((k) => ({ source: k, destination: `instanceIdentity.${k}` })) .forEach(copyInstanceOption) Object.keys(instanceDefaultConfig) diff --git a/src/modules/default_config_state.js b/src/modules/default_config_state.js index 429bdd931..1fe194aab 100644 --- a/src/modules/default_config_state.js +++ b/src/modules/default_config_state.js @@ -3,11 +3,10 @@ const browserLocale = (navigator.language || 'en').split('-')[0] /// Instance config entries provided by static config or pleroma api /// Put settings here only if it does not make sense for a normal user /// to override it. -export const staticOrApiConfigDefault = { - name: 'PleromaFE', +export const instanceIdentityDefault = { theme: null, palette: null, - style: 'breezy', + style: null, themeChecksum: undefined, defaultAvatar: '/images/avi.png', defaultBanner: '/images/banner.png', diff --git a/src/stores/instance.js b/src/stores/instance.js index 0838f7a51..f1f31a8d1 100644 --- a/src/stores/instance.js +++ b/src/stores/instance.js @@ -5,7 +5,7 @@ import { instanceDefaultProperties } from '../modules/config.js' import { defaultConfigLocal, instanceDefaultConfig, - staticOrApiConfigDefault, + instanceIdentityDefault, } from '../modules/default_config_state.js' import apiService from '../services/api/api.service.js' @@ -16,7 +16,6 @@ import { ensureFinalFallback } from 'src/i18n/languages.js' const REMOTE_INTERACTION_URL = '/main/ostatus' const defaultState = { - // Stuff from apiConfig name: 'Pleroma FE', registrationOpen: true, server: 'http://localhost:4040/', @@ -36,7 +35,7 @@ const defaultState = { // Instance-wide configurations that should not be changed by individual users instanceIdentity: { - ...staticOrApiConfigDefault, + ...instanceIdentityDefault, }, limits: { diff --git a/src/stores/interface.js b/src/stores/interface.js index 32a8226b4..caccd62b5 100644 --- a/src/stores/interface.js +++ b/src/stores/interface.js @@ -412,11 +412,13 @@ export const useInterfaceStore = defineStore('interface', { return result } - const { style: instanceStyleName, palette: instancePaletteName } = - useInstanceStore() + let { + theme: instanceThemeName, + style: instanceStyleName, + palette: instancePaletteName, + } = useInstanceStore().instanceIdentity let { - theme: instanceThemeV2Name, themesIndex, stylesIndex, palettesIndex, @@ -447,7 +449,7 @@ export const useInterfaceStore = defineStore('interface', { console.debug( `Instance V3 palette: ${instancePaletteName}, style: ${instanceStyleName}`, ) - console.debug('Instance V2 theme: ' + instanceThemeV2Name) + console.debug('Instance V2 theme: ' + instanceThemeName) if ( userPaletteName || @@ -456,11 +458,11 @@ export const useInterfaceStore = defineStore('interface', { userStyleCustomData || // User V2 overrides instance V3 ((instancePaletteName || instanceStyleName) && - instanceThemeV2Name == null && + instanceThemeName == null && userThemeV2Name == null) ) { // Palette and/or style overrides V2 themes - instanceThemeV2Name = null + instanceThemeName = null userThemeV2Name = null userThemeV2Source = null userThemeV2Snapshot = null @@ -470,7 +472,7 @@ export const useInterfaceStore = defineStore('interface', { userThemeV2Name || userThemeV2Snapshot || userThemeV2Source || - instanceThemeV2Name + instanceThemeName ) { majorVersionUsed = 'v2' } else { @@ -588,7 +590,7 @@ export const useInterfaceStore = defineStore('interface', { 'theme', themesIndex, userThemeV2Source || userThemeV2Snapshot, - userThemeV2Name || instanceThemeV2Name, + userThemeV2Name || instanceThemeName, ) this.themeNameUsed = theme.nameUsed this.themeDataUsed = theme.dataUsed