Skip to content

Commit

Permalink
Update index.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
popy01012 authored Dec 12, 2024
1 parent 2fa9aeb commit 82d92cc
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createRoot } from "react-dom/client";
import { IconButton } from "@flow/components";
import { useT } from "@flow/lib/i18n";
import { type NodeType } from "@flow/types";
import { useCurrentWorkflowId } from "@flow/stores";

type ToolboxItem<T> = {
id: T;
Expand All @@ -36,7 +37,9 @@ type Props = {
const Toolbox: React.FC<Props> = ({ canUndo, canRedo, onRedo, onUndo }) => {
const t = useT();

const availableTools: Tool[] = [
const [workflowId] = useCurrentWorkflowId();

const allTools: Tool[] = [
{
id: "reader",
name: t("Reader Node"),
Expand Down Expand Up @@ -69,6 +72,11 @@ const Toolbox: React.FC<Props> = ({ canUndo, canRedo, onRedo, onUndo }) => {
},
];

const availableTools =
workflowId === "main"
? allTools
: allTools.filter((tool) => tool.id !== "reader" && tool.id !== "writer");

const availableActions: Action[] = [
{
id: "undo",
Expand Down

0 comments on commit 82d92cc

Please sign in to comment.