From c7ca7bf2098e235e2ed3223401d99248b1fcf947 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 1 Mar 2024 19:07:52 -0300 Subject: [PATCH] Refactor paste function in flowStore.ts --- src/frontend/src/stores/flowStore.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 1725de2a0..a373123e8 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -219,8 +219,16 @@ const useFlowStore = create((set, get) => ({ ); }, paste: (selection, position) => { - if(selection.nodes.some((node) => node.data.type === "ChatInput") && checkChatInput(get().nodes)){ - useAlertStore.getState().setErrorData({title: "Error pasting components", list: ["You can only have one ChatInput component in the flow"]}); + if ( + selection.nodes.some((node) => node.data.type === "ChatInput") && + checkChatInput(get().nodes) + ) { + useAlertStore + .getState() + .setErrorData({ + title: "Error pasting components", + list: ["You can only have one ChatInput component in the flow"], + }); return; } let minimumX = Infinity; @@ -491,7 +499,6 @@ const useFlowStore = create((set, get) => ({ updateVerticesBuild: ( vertices: { verticesIds: string[]; - verticesOrder: string[][]; verticesLayers: string[][]; runId: string; } | null