From b8581581ea13f724bd8e2511c9640caa27888d3c Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Sun, 23 Jun 2024 21:09:00 +0000 Subject: [PATCH] Apply Prettier formatting --- .../FlowPage/components/PageComponent/index.tsx | 13 ++++++++----- src/frontend/src/stores/flowStore.ts | 11 ++++++++--- src/frontend/src/utils/reactflowUtils.ts | 11 ++++++++--- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx index d5a18f261..f302c70e3 100644 --- a/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx @@ -172,11 +172,14 @@ export default function Page({ } }, [currentFlowId, reactFlowInstance]); -useEffect(() => { - if(checkOldComponents({nodes:flow?.data?.nodes ?? []})){ - setNoticeData({title:"Components created before Langflow 1.0 may be unstable. Ensure components are up to date."}) - } -},[]) + useEffect(() => { + if (checkOldComponents({ nodes: flow?.data?.nodes ?? [] })) { + setNoticeData({ + title: + "Components created before Langflow 1.0 may be unstable. Ensure components are up to date.", + }); + } + }, []); useEffect(() => { return () => { diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 05f5ff948..9167a6b05 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -241,9 +241,14 @@ const useFlowStore = create((set, get) => ({ }); return; } - if(selection.nodes){ - if(checkOldComponents({nodes:selection.nodes ?? []})){ - useAlertStore.getState().setNoticeData({title:"Components created before Langflow 1.0 may be unstable. Ensure components are up to date."}) + if (selection.nodes) { + if (checkOldComponents({ nodes: selection.nodes ?? [] })) { + useAlertStore + .getState() + .setNoticeData({ + title: + "Components created before Langflow 1.0 may be unstable. Ensure components are up to date.", + }); } } let minimumX = Infinity; diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts index 34cefa4a1..9b62b2624 100644 --- a/src/frontend/src/utils/reactflowUtils.ts +++ b/src/frontend/src/utils/reactflowUtils.ts @@ -1512,7 +1512,12 @@ export function getGroupOutputNodeId( return { id: node.id, outputName: p_name }; } -export function checkOldComponents({nodes}:{nodes:any[]}) { - return nodes.some((node) => node.data.node?.template.code && (node.data.node?.template.code.value as string).includes("(CustomComponent):")); - +export function checkOldComponents({ nodes }: { nodes: any[] }) { + return nodes.some( + (node) => + node.data.node?.template.code && + (node.data.node?.template.code.value as string).includes( + "(CustomComponent):", + ), + ); }