Compare commits
3 commits
ac437dd9ff
...
2f10b94af8
Author | SHA1 | Date | |
---|---|---|---|
|
2f10b94af8 | ||
|
406b973654 | ||
|
89b916da28 |
1 changed files with 3 additions and 22 deletions
|
@ -324,7 +324,6 @@ 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
|
||||||
|
@ -334,13 +333,15 @@ const interfaceMod = {
|
||||||
|
|
||||||
if (result.nameUsed == null) {
|
if (result.nameUsed == null) {
|
||||||
result.dataUsed = null
|
result.dataUsed = null
|
||||||
console.log('GDR -', result)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
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}'`)
|
||||||
|
@ -351,12 +352,9 @@ 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
|
||||||
|
@ -499,20 +497,6 @@ 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
|
||||||
}
|
}
|
||||||
|
@ -566,12 +550,9 @@ 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