fix(tabsContext.tsx): remove unnecessary line that sets official property to false on component.node

fix(nodeToolbarComponent/index.tsx): fix downloadNode function call to pass a deep clone of data instead of the original data object
fix(reactflowUtils.ts): remove unnecessary line that sets official property to false on nodeData.node
This commit is contained in:
anovazzi1 2023-10-23 17:10:12 -03:00
commit 25227db9f7
3 changed files with 2 additions and 3 deletions

View file

@ -697,7 +697,6 @@ export function TabsProvider({ children }: { children: ReactNode }) {
` (${increment})`; ` (${increment})`;
} }
} }
component.node!.official = false;
addFlow(true, createFlowComponent(component)); addFlow(true, createFlowComponent(component));
} }

View file

@ -75,8 +75,7 @@ export default function NodeToolbarComponent({
updateNodeInternals(data.id); updateNodeInternals(data.id);
break; break;
case "Download": case "Download":
//TODO add logic to save node on backend and update toolbar downloadNode(createFlowComponent(cloneDeep(data)));
downloadNode(createFlowComponent(data));
break; break;
case "Share": case "Share":
//TODO add logic to save node on backend and update toolbar //TODO add logic to save node on backend and update toolbar

View file

@ -1065,6 +1065,7 @@ export function getGroupStatus(
} }
export function createFlowComponent(nodeData: NodeDataType): FlowType { export function createFlowComponent(nodeData: NodeDataType): FlowType {
nodeData.node!.official = false;
const flowNode: FlowType = { const flowNode: FlowType = {
data: { data: {
edges: [], edges: [],