diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index f52cc514c..ac85a7f7f 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -65,7 +65,7 @@ export default function GenericNode({ const updateNodeInternals = useUpdateNodeInternals(); const setErrorData = useAlertStore((state) => state.setErrorData); const isDark = useDarkStore((state) => state.dark); - + const version = useDarkStore((state) => state.version); const takeSnapshot = useFlowsManagerStore((state) => state.takeSnapshot); const [inputName, setInputName] = useState(false); @@ -215,6 +215,23 @@ export default function GenericNode({ setShowNode(data.showNode ?? true); }, [data.showNode]); + useEffect(() => { + if (buildStatus === BuildStatus.BUILT && !isBuilding) { + setNode(data.id, (old) => { + return { + ...old, + data: { + ...old.data, + node: { + ...old.data.node, + lf_version: version, + }, + }, + }; + }); + } + }, [buildStatus, isBuilding]); + const [loadingUpdate, setLoadingUpdate] = useState(false); const [showHiddenOutputs, setShowHiddenOutputs] = useState(false); diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts index 315912e95..e4d6fade2 100644 --- a/src/frontend/src/types/api/index.ts +++ b/src/frontend/src/types/api/index.ts @@ -43,6 +43,7 @@ export type APIClassType = { official?: boolean; outputs?: Array; frozen?: boolean; + lf_version?: string; flow?: FlowType; field_order?: string[]; [key: string]: