Skip to content

feat: update GenericNode to include lf_version in node data #3112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/frontend/src/CustomNodes/GenericNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -215,6 +215,24 @@ 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);
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/types/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type APIClassType = {
official?: boolean;
outputs?: Array<OutputFieldType>;
frozen?: boolean;
lf_version?: string;
flow?: FlowType;
field_order?: string[];
[key: string]:
Expand Down
Loading