Apply Prettier formatting
This commit is contained in:
parent
696c07991d
commit
b8581581ea
3 changed files with 24 additions and 11 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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):",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue