improve robustness and responsiveness
This commit is contained in:
parent
4aaf6bcc59
commit
a2a58dc082
2 changed files with 31 additions and 15 deletions
|
|
@ -112,9 +112,14 @@ export default {
|
|||
},
|
||||
getColorFallback () {
|
||||
if (this.staticVars && this.selected?.color) {
|
||||
const computedColor = findColor(this.selected.color, { dynamicVars: {}, staticVars: this.staticVars }, true)
|
||||
if (computedColor) return rgb2hex(computedColor)
|
||||
return null
|
||||
try {
|
||||
const computedColor = findColor(this.selected.color, { dynamicVars: {}, staticVars: this.staticVars }, true)
|
||||
if (computedColor) return rgb2hex(computedColor)
|
||||
return null
|
||||
} catch (e) {
|
||||
console.warn(e)
|
||||
return null
|
||||
}
|
||||
} else {
|
||||
return this.currentFallback?.color
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue