Compare commits
5 commits
2f10b94af8
...
ac437dd9ff
Author | SHA1 | Date | |
---|---|---|---|
|
ac437dd9ff | ||
|
445d8a2f05 | ||
|
3824d08421 | ||
|
fbc0a78235 | ||
|
926c1a43e0 |
3 changed files with 31 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',
|
||||||
|
|
|
@ -324,6 +324,7 @@ const interfaceMod = {
|
||||||
const getData = async (resource, index, customData, name) => {
|
const getData = async (resource, index, customData, name) => {
|
||||||
const capitalizedResource = resource[0].toUpperCase() + resource.slice(1)
|
const capitalizedResource = resource[0].toUpperCase() + resource.slice(1)
|
||||||
const result = {}
|
const result = {}
|
||||||
|
console.log('GD', resource, index, customData, name)
|
||||||
|
|
||||||
if (customData) {
|
if (customData) {
|
||||||
result.nameUsed = 'custom' // custom data overrides name
|
result.nameUsed = 'custom' // custom data overrides name
|
||||||
|
@ -331,8 +332,9 @@ const interfaceMod = {
|
||||||
} else {
|
} else {
|
||||||
result.nameUsed = name
|
result.nameUsed = name
|
||||||
|
|
||||||
if (result.nameUsed === 'stock') {
|
if (result.nameUsed == null) {
|
||||||
result.dataUsed = null
|
result.dataUsed = null
|
||||||
|
console.log('GDR -', result)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,9 +351,12 @@ const interfaceMod = {
|
||||||
}
|
}
|
||||||
result.dataUsed = await fetchFunc()
|
result.dataUsed = await fetchFunc()
|
||||||
}
|
}
|
||||||
|
console.log('GDR +', result)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('RSI', rootState.instance)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
style: instanceStyleName,
|
style: instanceStyleName,
|
||||||
palette: instancePaletteName
|
palette: instancePaletteName
|
||||||
|
@ -448,8 +453,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,
|
||||||
|
@ -492,6 +499,20 @@ const interfaceMod = {
|
||||||
userThemeV2Source || userThemeV2Snapshot,
|
userThemeV2Source || userThemeV2Snapshot,
|
||||||
userThemeV2Name || instanceThemeV2Name
|
userThemeV2Name || instanceThemeV2Name
|
||||||
)
|
)
|
||||||
|
console.log(
|
||||||
|
'V2 INDEX',
|
||||||
|
themesIndex
|
||||||
|
)
|
||||||
|
console.log(
|
||||||
|
'V2 DATA',
|
||||||
|
userThemeV2Source,
|
||||||
|
userThemeV2Snapshot
|
||||||
|
)
|
||||||
|
console.log(
|
||||||
|
'V2 NAME',
|
||||||
|
userThemeV2Name,
|
||||||
|
instanceThemeV2Name
|
||||||
|
)
|
||||||
// themeNameUsed = theme.nameUsed
|
// themeNameUsed = theme.nameUsed
|
||||||
state.themeDataUsed = theme.dataUsed
|
state.themeDataUsed = theme.dataUsed
|
||||||
}
|
}
|
||||||
|
@ -545,9 +566,12 @@ const interfaceMod = {
|
||||||
return result
|
return result
|
||||||
})()
|
})()
|
||||||
|
|
||||||
|
console.log(state.themeNameUsed, state.themeDataUsed)
|
||||||
const theme2ruleset = state.themeDataUsed && convertTheme2To3(normalizeThemeData(state.themeDataUsed))
|
const theme2ruleset = state.themeDataUsed && convertTheme2To3(normalizeThemeData(state.themeDataUsed))
|
||||||
const hacks = []
|
const hacks = []
|
||||||
|
|
||||||
|
console.log('T2R', theme2ruleset)
|
||||||
|
|
||||||
Object.entries(theme3hacks).forEach(([key, value]) => {
|
Object.entries(theme3hacks).forEach(([key, value]) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'fonts': {
|
case 'fonts': {
|
||||||
|
|
Loading…
Add table
Reference in a new issue