commit: 3d78a7377e7aeb7871b11155dca251f8467d1cb0
parent 7314092d19784add77efcf219bc4e1a478def7f0
Author: Henry Jameson <me@hjkos.com>
Date: Mon, 28 Oct 2024 21:22:56 +0200
fix states rules not being filtered properly.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js
@@ -672,8 +672,10 @@ export default {
const rule = parentComponentMatch ? r.parent : r
if (rule.component !== selectedComponentName.value) return false
if (rule.variant !== selectedVariant.value) return false
- return r.state.filter(x => x !== 'normal').every(x => selectedState.has(x)) &&
- [...selectedState.values()].every(x => r.state.indexOf(x) >= 0)
+ const ruleState = new Set(rule.state.filter(x => x !== 'normal'))
+ const differenceA = [...ruleState].filter(x => !selectedState.has(x))
+ const differenceB = [...selectedState].filter(x => !ruleState.has(x))
+ return (differenceA.length + differenceB.length) === 0
})
const sorted = [...filtered]
.filter(x => x.component === selectedComponentName.value)
@@ -715,7 +717,6 @@ export default {
})
const dynamicVars = computed(() => {
- console.log('ERR', selectedComponentName.value)
return previewRules.value[0].dynamicVars
})