From 32d98c9b854194ed5a27b407ebe11a7b0bdb603b Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 24 Jan 2024 17:25:57 +0100 Subject: [PATCH] Fixed pinned attribute --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 7 +++++-- src/frontend/src/types/flow/index.ts | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 6db26e9ce..ac87f0b8d 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -107,7 +107,7 @@ export default function GenericNode({ }, [flowPool, data.id]); const showNode = data.showNode ?? true; - const pinned = data.pinned ?? true; + const pinned = data.node?.pinned ?? true; const nameEditable = data.node?.flow || data.type === "CustomComponent"; @@ -327,7 +327,10 @@ export default function GenericNode({ ...old, data: { ...old.data, - pinned: old?.data?.pinned ? false : true, + node: { + ...old.data.node, + pinned: old.data?.node?.pinned ? false : true, + } }, })); }} diff --git a/src/frontend/src/types/flow/index.ts b/src/frontend/src/types/flow/index.ts index a18461ded..783a8963d 100644 --- a/src/frontend/src/types/flow/index.ts +++ b/src/frontend/src/types/flow/index.ts @@ -21,7 +21,6 @@ export type NodeType = { export type NodeDataType = { showNode?: boolean; - pinned?: boolean; type: string; node?: APIClassType; id: string;