Skip to content

Commit

Permalink
#835 Fix master nodes incorrectly refactored (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
langonginc authored Oct 1, 2024
1 parent f3edfcf commit 66445d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/svgs/nodes/master.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const MasterNode = (props: NodeComponentProps<MasterAttributes>) => {

const masterTransform = attrs.transform ?? defaultMasterTransform;

const elements = React.useMemo(() => dfsCreateElement(attrs.svgs), [attrs.svgs]);
const elements = React.useMemo(() => dfsCreateElement(attrs.svgs), [attrs]);

return React.createElement(
'g',
Expand Down Expand Up @@ -141,7 +141,7 @@ const attrsComponent = (props: AttrsProps<MasterAttributes>) => {

const getComponentValue = (query: string) => {
const p = attrs.components.find(c => c.id === query);
return p ? p.type ?? p.defaultValue : undefined;
return p ? p.value ?? p.defaultValue : undefined;
};

const handleImportParam = (s: string) => {
Expand Down Expand Up @@ -190,7 +190,7 @@ const attrsComponent = (props: AttrsProps<MasterAttributes>) => {
return {
label: t(label),
type: 'switch',
isChecked: (value ?? defaultValue) === 'true',
isChecked: value !== undefined ? !!value : defaultValue,
onChange: v => {
attrs.components[i].value = v;
handleAttrsUpdate(id, { ...attrs, components: attrs.components });
Expand Down

0 comments on commit 66445d7

Please sign in to comment.