Compare commits
3 commits
ac437dd9ff
...
2f10b94af8
Author | SHA1 | Date | |
---|---|---|---|
|
2f10b94af8 | ||
|
406b973654 | ||
|
89b916da28 |
3 changed files with 12 additions and 3 deletions
|
@ -123,6 +123,8 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
copyInstanceOption('theme')
|
copyInstanceOption('theme')
|
||||||
|
copyInstanceOption('style')
|
||||||
|
copyInstanceOption('palette')
|
||||||
copyInstanceOption('nsfwCensorImage')
|
copyInstanceOption('nsfwCensorImage')
|
||||||
copyInstanceOption('background')
|
copyInstanceOption('background')
|
||||||
copyInstanceOption('hidePostStats')
|
copyInstanceOption('hidePostStats')
|
||||||
|
|
|
@ -99,6 +99,8 @@ const defaultState = {
|
||||||
sidebarRight: false,
|
sidebarRight: false,
|
||||||
subjectLineBehavior: 'email',
|
subjectLineBehavior: 'email',
|
||||||
theme: 'pleroma-dark',
|
theme: 'pleroma-dark',
|
||||||
|
palette: null,
|
||||||
|
style: null,
|
||||||
emojiReactionsScale: 0.5,
|
emojiReactionsScale: 0.5,
|
||||||
textSize: '14px',
|
textSize: '14px',
|
||||||
emojiSize: '2.2rem',
|
emojiSize: '2.2rem',
|
||||||
|
|
|
@ -331,7 +331,7 @@ const interfaceMod = {
|
||||||
} else {
|
} else {
|
||||||
result.nameUsed = name
|
result.nameUsed = name
|
||||||
|
|
||||||
if (result.nameUsed === 'stock') {
|
if (result.nameUsed == null) {
|
||||||
result.dataUsed = null
|
result.dataUsed = null
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
@ -339,6 +339,9 @@ const interfaceMod = {
|
||||||
let fetchFunc = index[result.nameUsed]
|
let fetchFunc = index[result.nameUsed]
|
||||||
// Fallbacks
|
// Fallbacks
|
||||||
if (!fetchFunc) {
|
if (!fetchFunc) {
|
||||||
|
if (resource === 'style' || resource === 'palette') {
|
||||||
|
return result
|
||||||
|
}
|
||||||
const newName = Object.keys(index)[0]
|
const newName = Object.keys(index)[0]
|
||||||
fetchFunc = index[newName]
|
fetchFunc = index[newName]
|
||||||
console.warn(`${capitalizedResource} with id '${state.styleNameUsed}' not found, trying back to '${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.paletteNameUsed = palette.nameUsed
|
||||||
state.paletteDataUsed = palette.dataUsed
|
state.paletteDataUsed = palette.dataUsed
|
||||||
state.paletteDataUsed.link = state.paletteDataUsed.link || state.paletteDataUsed.accent
|
if (state.paletteDataUsed) {
|
||||||
state.paletteDataUsed.accent = state.paletteDataUsed.accent || state.paletteDataUsed.link
|
state.paletteDataUsed.link = state.paletteDataUsed.link || state.paletteDataUsed.accent
|
||||||
|
state.paletteDataUsed.accent = state.paletteDataUsed.accent || state.paletteDataUsed.link
|
||||||
|
}
|
||||||
if (Array.isArray(state.paletteDataUsed)) {
|
if (Array.isArray(state.paletteDataUsed)) {
|
||||||
const [
|
const [
|
||||||
name,
|
name,
|
||||||
|
|
Loading…
Add table
Reference in a new issue