Compare commits

...

3 commits

Author SHA1 Message Date
Henry Jameson
2f10b94af8 Merge branch 'themes3-grand-finale-maybe' into shigusegubu-themes3 2024-11-28 18:10:16 +02:00
Henry Jameson
406b973654 don't fallback to first style if none specified 2024-11-28 18:09:42 +02:00
Henry Jameson
89b916da28 fixes for clean state 2024-11-28 18:07:22 +02:00
3 changed files with 12 additions and 3 deletions

View file

@ -123,6 +123,8 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
}
copyInstanceOption('theme')
copyInstanceOption('style')
copyInstanceOption('palette')
copyInstanceOption('nsfwCensorImage')
copyInstanceOption('background')
copyInstanceOption('hidePostStats')

View file

@ -99,6 +99,8 @@ const defaultState = {
sidebarRight: false,
subjectLineBehavior: 'email',
theme: 'pleroma-dark',
palette: null,
style: null,
emojiReactionsScale: 0.5,
textSize: '14px',
emojiSize: '2.2rem',

View file

@ -331,7 +331,7 @@ const interfaceMod = {
} else {
result.nameUsed = name
if (result.nameUsed === 'stock') {
if (result.nameUsed == null) {
result.dataUsed = null
return result
}
@ -339,6 +339,9 @@ const interfaceMod = {
let fetchFunc = index[result.nameUsed]
// Fallbacks
if (!fetchFunc) {
if (resource === 'style' || resource === 'palette') {
return result
}
const newName = Object.keys(index)[0]
fetchFunc = index[newName]
console.warn(`${capitalizedResource} with id '${state.styleNameUsed}' not found, trying back to '${newName}'`)
@ -448,8 +451,10 @@ const interfaceMod = {
)
state.paletteNameUsed = palette.nameUsed
state.paletteDataUsed = palette.dataUsed
if (state.paletteDataUsed) {
state.paletteDataUsed.link = state.paletteDataUsed.link || state.paletteDataUsed.accent
state.paletteDataUsed.accent = state.paletteDataUsed.accent || state.paletteDataUsed.link
}
if (Array.isArray(state.paletteDataUsed)) {
const [
name,