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 {
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)

View file

@ -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',

View file

@ -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: {

View file

@ -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