chore(tabsContext.tsx): import cloneDeep function from lodash to improve code readability and maintainability
fix(tabsContext.tsx): fix comment typo fix(tabsContext.tsx): add missing semicolon to improve code consistency fix(tabsContext.tsx): clone edge data object to prevent mutation of original object refactor(PageComponent/index.tsx): remove unnecessary comment
This commit is contained in:
parent
af996b171b
commit
a9a1316183
2 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { AxiosError } from "axios";
|
||||
import _ from "lodash";
|
||||
import _, { cloneDeep } from "lodash";
|
||||
import {
|
||||
ReactNode,
|
||||
createContext,
|
||||
|
|
@ -428,6 +428,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
|||
id: source,
|
||||
});
|
||||
sourceHandleObject.id = source;
|
||||
|
||||
edge.data.sourceHandle = sourceHandleObject;
|
||||
const targetHandleObject: targetHandleType = scapeJSONParse(
|
||||
edge.targetHandle!
|
||||
|
|
@ -452,6 +453,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
|||
sourceHandle,
|
||||
targetHandle,
|
||||
id,
|
||||
data: cloneDeep(edge.data),
|
||||
style: { stroke: "#555" },
|
||||
className:
|
||||
targetHandleObject.type === "Text"
|
||||
|
|
|
|||
|
|
@ -310,7 +310,6 @@ export default function Page({
|
|||
event.dataTransfer.getData("nodedata")
|
||||
);
|
||||
|
||||
// If data type is not "chatInput" or if there are no "chatInputNode" nodes present in the ReactFlow instance, create a new node
|
||||
// Calculate the position where the node should be created
|
||||
const position = reactFlowInstance!.project({
|
||||
x: event.clientX - reactflowBounds!.left,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue