Fix p's weird corrupt theme data crashing theme engine
This commit is contained in:
parent
28ebb8b0ae
commit
272ba8f7a9
|
@ -242,9 +242,18 @@ export const generateShadows = (input, colors) => {
|
||||||
panelHeader: 'panel',
|
panelHeader: 'panel',
|
||||||
input: 'input'
|
input: 'input'
|
||||||
}
|
}
|
||||||
const inputShadows = input.shadows && !input.themeEngineVersion
|
|
||||||
? shadows2to3(input.shadows, input.opacity)
|
const cleanInputShadows = Object.fromEntries(
|
||||||
: input.shadows || {}
|
Object.entries(input.shadows)
|
||||||
|
.map(([name, shadowSlot]) => [
|
||||||
|
name,
|
||||||
|
// defaulting color to black to avoid potential problems
|
||||||
|
shadowSlot.map(shadowDef => ({ color: '#000000', ...shadowDef }))
|
||||||
|
])
|
||||||
|
)
|
||||||
|
const inputShadows = cleanInputShadows && !input.themeEngineVersion
|
||||||
|
? shadows2to3(cleanInputShadows, input.opacity)
|
||||||
|
: cleanInputShadows || {}
|
||||||
const shadows = Object.entries({
|
const shadows = Object.entries({
|
||||||
...DEFAULT_SHADOWS,
|
...DEFAULT_SHADOWS,
|
||||||
...inputShadows
|
...inputShadows
|
||||||
|
|
Loading…
Reference in New Issue