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

@ -174,9 +174,12 @@ export default function Page({
useEffect(() => { useEffect(() => {
if (checkOldComponents({ nodes: flow?.data?.nodes ?? [] })) { if (checkOldComponents({ nodes: flow?.data?.nodes ?? [] })) {
setNoticeData({title:"Components created before Langflow 1.0 may be unstable. Ensure components are up to date."}) setNoticeData({
title:
"Components created before Langflow 1.0 may be unstable. Ensure components are up to date.",
});
} }
},[]) }, []);
useEffect(() => { useEffect(() => {
return () => { return () => {

View file

@ -243,7 +243,12 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
} }
if (selection.nodes) { if (selection.nodes) {
if (checkOldComponents({ nodes: 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."}) useAlertStore
.getState()
.setNoticeData({
title:
"Components created before Langflow 1.0 may be unstable. Ensure components are up to date.",
});
} }
} }
let minimumX = Infinity; let minimumX = Infinity;

View file

@ -1513,6 +1513,11 @@ export function getGroupOutputNodeId(
} }
export function checkOldComponents({ nodes }: { nodes: any[] }) { 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):")); return nodes.some(
(node) =>
node.data.node?.template.code &&
(node.data.node?.template.code.value as string).includes(
"(CustomComponent):",
),
);
} }