Fixed a color change bug in the node configuration sidebar

This commit is contained in:
Nicole Rappe 2025-05-31 02:16:32 -06:00
parent c721daf5c4
commit 52a09006d9

View File

@ -59,21 +59,11 @@ export default function NodeConfigurationSidebar({ drawerOpen, setDrawerOpen, ti
const newValue = e.target.value; const newValue = e.target.value;
if (!nodeId) return; if (!nodeId) return;
effectiveSetNodes((nds) => effectiveSetNodes((nds) =>
nds.map((n) => { nds.map((n) =>
if (n.id !== nodeId) return n; n.id === nodeId
const accentColor = color.hex; ? { ...n, data: { ...n.data, [field.key]: newValue } }
const accentColorDark = darkenColor(accentColor, 0.7); : n
return { )
...n,
data: { ...n.data, accentColor },
style: {
...n.style,
"--borealis-accent": accentColor,
"--borealis-accent-dark": accentColorDark,
"--borealis-title": accentColor,
},
};
})
); );
window.BorealisValueBus[nodeId] = newValue; window.BorealisValueBus[nodeId] = newValue;
}} }}