renamed identity stuff to be more clear

This commit is contained in:
Henry Jameson 2026-03-24 14:37:51 +02:00
commit a1cde6ce0f
4 changed files with 16 additions and 16 deletions

View file

@ -40,7 +40,7 @@ import { useUserHighlightStore } from 'src/stores/user_highlight.js'
import VBodyScrollLock from 'src/directives/body_scroll_lock' import VBodyScrollLock from 'src/directives/body_scroll_lock'
import { import {
instanceDefaultConfig, instanceDefaultConfig,
staticOrApiConfigDefault, instanceIdentityDefault,
} from 'src/modules/default_config_state.js' } from 'src/modules/default_config_state.js'
let staticInitialResults = null 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}` })) .map((k) => ({ source: k, destination: `instanceIdentity.${k}` }))
.forEach(copyInstanceOption) .forEach(copyInstanceOption)
Object.keys(instanceDefaultConfig) Object.keys(instanceDefaultConfig)

View file

@ -3,11 +3,10 @@ const browserLocale = (navigator.language || 'en').split('-')[0]
/// Instance config entries provided by static config or pleroma api /// Instance config entries provided by static config or pleroma api
/// Put settings here only if it does not make sense for a normal user /// Put settings here only if it does not make sense for a normal user
/// to override it. /// to override it.
export const staticOrApiConfigDefault = { export const instanceIdentityDefault = {
name: 'PleromaFE',
theme: null, theme: null,
palette: null, palette: null,
style: 'breezy', style: null,
themeChecksum: undefined, themeChecksum: undefined,
defaultAvatar: '/images/avi.png', defaultAvatar: '/images/avi.png',
defaultBanner: '/images/banner.png', defaultBanner: '/images/banner.png',

View file

@ -5,7 +5,7 @@ import { instanceDefaultProperties } from '../modules/config.js'
import { import {
defaultConfigLocal, defaultConfigLocal,
instanceDefaultConfig, instanceDefaultConfig,
staticOrApiConfigDefault, instanceIdentityDefault,
} from '../modules/default_config_state.js' } from '../modules/default_config_state.js'
import apiService from '../services/api/api.service.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 REMOTE_INTERACTION_URL = '/main/ostatus'
const defaultState = { const defaultState = {
// Stuff from apiConfig
name: 'Pleroma FE', name: 'Pleroma FE',
registrationOpen: true, registrationOpen: true,
server: 'http://localhost:4040/', server: 'http://localhost:4040/',
@ -36,7 +35,7 @@ const defaultState = {
// Instance-wide configurations that should not be changed by individual users // Instance-wide configurations that should not be changed by individual users
instanceIdentity: { instanceIdentity: {
...staticOrApiConfigDefault, ...instanceIdentityDefault,
}, },
limits: { limits: {

View file

@ -412,11 +412,13 @@ export const useInterfaceStore = defineStore('interface', {
return result return result
} }
const { style: instanceStyleName, palette: instancePaletteName } = let {
useInstanceStore() theme: instanceThemeName,
style: instanceStyleName,
palette: instancePaletteName,
} = useInstanceStore().instanceIdentity
let { let {
theme: instanceThemeV2Name,
themesIndex, themesIndex,
stylesIndex, stylesIndex,
palettesIndex, palettesIndex,
@ -447,7 +449,7 @@ export const useInterfaceStore = defineStore('interface', {
console.debug( console.debug(
`Instance V3 palette: ${instancePaletteName}, style: ${instanceStyleName}`, `Instance V3 palette: ${instancePaletteName}, style: ${instanceStyleName}`,
) )
console.debug('Instance V2 theme: ' + instanceThemeV2Name) console.debug('Instance V2 theme: ' + instanceThemeName)
if ( if (
userPaletteName || userPaletteName ||
@ -456,11 +458,11 @@ export const useInterfaceStore = defineStore('interface', {
userStyleCustomData || userStyleCustomData ||
// User V2 overrides instance V3 // User V2 overrides instance V3
((instancePaletteName || instanceStyleName) && ((instancePaletteName || instanceStyleName) &&
instanceThemeV2Name == null && instanceThemeName == null &&
userThemeV2Name == null) userThemeV2Name == null)
) { ) {
// Palette and/or style overrides V2 themes // Palette and/or style overrides V2 themes
instanceThemeV2Name = null instanceThemeName = null
userThemeV2Name = null userThemeV2Name = null
userThemeV2Source = null userThemeV2Source = null
userThemeV2Snapshot = null userThemeV2Snapshot = null
@ -470,7 +472,7 @@ export const useInterfaceStore = defineStore('interface', {
userThemeV2Name || userThemeV2Name ||
userThemeV2Snapshot || userThemeV2Snapshot ||
userThemeV2Source || userThemeV2Source ||
instanceThemeV2Name instanceThemeName
) { ) {
majorVersionUsed = 'v2' majorVersionUsed = 'v2'
} else { } else {
@ -588,7 +590,7 @@ export const useInterfaceStore = defineStore('interface', {
'theme', 'theme',
themesIndex, themesIndex,
userThemeV2Source || userThemeV2Snapshot, userThemeV2Source || userThemeV2Snapshot,
userThemeV2Name || instanceThemeV2Name, userThemeV2Name || instanceThemeName,
) )
this.themeNameUsed = theme.nameUsed this.themeNameUsed = theme.nameUsed
this.themeDataUsed = theme.dataUsed this.themeDataUsed = theme.dataUsed