feat: update GenericNode to include lf_version in node data (#3112)
* feat: update GenericNode to include lf_version in node data * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
This commit is contained in:
parent
5076f2014e
commit
ca68414e6b
2 changed files with 19 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ export type APIClassType = {
|
|||
official?: boolean;
|
||||
outputs?: Array<OutputFieldType>;
|
||||
frozen?: boolean;
|
||||
lf_version?: string;
|
||||
flow?: FlowType;
|
||||
field_order?: string[];
|
||||
[key: string]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue