Skip to content

Commit

Permalink
Refactor nodeToolbarComponent to conditionally show tool mode button …
Browse files Browse the repository at this point in the history
…based on isGroup variable
  • Loading branch information
anovazzi1 committed Jan 2, 2025
1 parent 70eaacf commit 887bf97
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,17 @@ const NodeToolbarComponent = memo(
() => Object.keys(data.node!.template).includes("code"),
[data.node],
);
// Check if any of the data.node.template fields have tool_mode as True
// if so we can show the tool mode button
const hasToolMode = useMemo(
() => checkHasToolMode(data.node?.template ?? {}),
[data.node?.template],
);
const isGroup = useMemo(
() => (data.node?.flow ? true : false),
[data.node],
);

// Check if any of the data.node.template fields have tool_mode as True
// if so we can show the tool mode button
const hasToolMode = useMemo(
() => checkHasToolMode(data.node?.template ?? {}) && !isGroup,
[data.node?.template, isGroup],
);
const addFlow = useAddFlow();

const { mutate: patchUpdateFlow } = usePatchUpdateFlow();
Expand Down

0 comments on commit 887bf97

Please sign in to comment.