Apply Prettier formatting

This commit is contained in:
anovazzi1 2024-06-23 21:09:00 +00:00 • committed by Gabriel Luiz Freitas Almeida
commit b8581581ea
3 changed files with 24 additions and 11 deletions

View file

@ -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 () => {

View file

@ -241,9 +241,14 @@ const useFlowStore = create<FlowStoreType>((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;

View file

@ -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):",
),
);
}