Fix formatting and remove unused code
This commit is contained in:
parent
7b889fe651
commit
84160ce86e
6 changed files with 23 additions and 25 deletions
|
|
@ -23,7 +23,6 @@ import useFlowsManagerStore from "./stores/flowsManagerStore";
|
||||||
import { useTypesStore } from "./stores/typesStore";
|
import { useTypesStore } from "./stores/typesStore";
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
|
|
||||||
const errorData = useAlertStore((state) => state.errorData);
|
const errorData = useAlertStore((state) => state.errorData);
|
||||||
const errorOpen = useAlertStore((state) => state.errorOpen);
|
const errorOpen = useAlertStore((state) => state.errorOpen);
|
||||||
const setErrorOpen = useAlertStore((state) => state.setErrorOpen);
|
const setErrorOpen = useAlertStore((state) => state.setErrorOpen);
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,6 @@ export default function ParameterComponent({
|
||||||
takeSnapshot();
|
takeSnapshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setNode(data.id, (oldNode) => {
|
setNode(data.id, (oldNode) => {
|
||||||
let newNode = cloneDeep(oldNode);
|
let newNode = cloneDeep(oldNode);
|
||||||
|
|
||||||
|
|
@ -273,9 +272,11 @@ export default function ParameterComponent({
|
||||||
<Handle
|
<Handle
|
||||||
type={left ? "target" : "source"}
|
type={left ? "target" : "source"}
|
||||||
position={left ? Position.Left : Position.Right}
|
position={left ? Position.Left : Position.Right}
|
||||||
key={proxy
|
key={
|
||||||
|
proxy
|
||||||
? scapedJSONStringfy({ ...id, proxy })
|
? scapedJSONStringfy({ ...id, proxy })
|
||||||
: scapedJSONStringfy(id)}
|
: scapedJSONStringfy(id)
|
||||||
|
}
|
||||||
id={
|
id={
|
||||||
proxy
|
proxy
|
||||||
? scapedJSONStringfy({ ...id, proxy })
|
? scapedJSONStringfy({ ...id, proxy })
|
||||||
|
|
@ -348,9 +349,11 @@ export default function ParameterComponent({
|
||||||
<Handle
|
<Handle
|
||||||
type={left ? "target" : "source"}
|
type={left ? "target" : "source"}
|
||||||
position={left ? Position.Left : Position.Right}
|
position={left ? Position.Left : Position.Right}
|
||||||
key={proxy
|
key={
|
||||||
|
proxy
|
||||||
? scapedJSONStringfy({ ...id, proxy })
|
? scapedJSONStringfy({ ...id, proxy })
|
||||||
: scapedJSONStringfy(id)}
|
: scapedJSONStringfy(id)
|
||||||
|
}
|
||||||
id={
|
id={
|
||||||
proxy
|
proxy
|
||||||
? scapedJSONStringfy({ ...id, proxy })
|
? scapedJSONStringfy({ ...id, proxy })
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import ReactFlow, {
|
||||||
OnMove,
|
OnMove,
|
||||||
OnSelectionChangeParams,
|
OnSelectionChangeParams,
|
||||||
SelectionDragHandler,
|
SelectionDragHandler,
|
||||||
addEdge,
|
|
||||||
updateEdge,
|
updateEdge,
|
||||||
} from "reactflow";
|
} from "reactflow";
|
||||||
import GenericNode from "../../../../CustomNodes/GenericNode";
|
import GenericNode from "../../../../CustomNodes/GenericNode";
|
||||||
|
|
@ -19,13 +18,12 @@ import useFlowStore from "../../../../stores/flowStore";
|
||||||
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
import useFlowsManagerStore from "../../../../stores/flowsManagerStore";
|
||||||
import { useTypesStore } from "../../../../stores/typesStore";
|
import { useTypesStore } from "../../../../stores/typesStore";
|
||||||
import { APIClassType } from "../../../../types/api";
|
import { APIClassType } from "../../../../types/api";
|
||||||
import { FlowType, NodeType, targetHandleType } from "../../../../types/flow";
|
import { FlowType, NodeType } from "../../../../types/flow";
|
||||||
import {
|
import {
|
||||||
generateFlow,
|
generateFlow,
|
||||||
generateNodeFromFlow,
|
generateNodeFromFlow,
|
||||||
getNodeId,
|
getNodeId,
|
||||||
isValidConnection,
|
isValidConnection,
|
||||||
scapeJSONParse,
|
|
||||||
validateSelection,
|
validateSelection,
|
||||||
} from "../../../../utils/reactflowUtils";
|
} from "../../../../utils/reactflowUtils";
|
||||||
import { getRandomName, isWrappedWithClass } from "../../../../utils/utils";
|
import { getRandomName, isWrappedWithClass } from "../../../../utils/utils";
|
||||||
|
|
@ -175,8 +173,8 @@ export default function Page({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
cleanFlow();
|
cleanFlow();
|
||||||
}
|
};
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
const onConnectMod = useCallback(
|
const onConnectMod = useCallback(
|
||||||
(params: Connection) => {
|
(params: Connection) => {
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
},
|
},
|
||||||
getFilterEdge: [],
|
getFilterEdge: [],
|
||||||
onConnect: (connection) => {
|
onConnect: (connection) => {
|
||||||
let newEdges: Edge[] = []
|
let newEdges: Edge[] = [];
|
||||||
get().setEdges((oldEdges) => {
|
get().setEdges((oldEdges) => {
|
||||||
newEdges = addEdge(
|
newEdges = addEdge(
|
||||||
{
|
{
|
||||||
|
|
@ -287,8 +287,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
oldEdges
|
oldEdges
|
||||||
);
|
);
|
||||||
return newEdges;
|
return newEdges;
|
||||||
|
});
|
||||||
})
|
|
||||||
useFlowsManagerStore
|
useFlowsManagerStore
|
||||||
.getState()
|
.getState()
|
||||||
.autoSaveCurrentFlow(
|
.autoSaveCurrentFlow(
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,4 @@ export const useTypesStore = create<TypesStoreType>((set, get) => ({
|
||||||
let newChange = typeof change === "function" ? change(get().data) : change;
|
let newChange = typeof change === "function" ? change(get().data) : change;
|
||||||
set({ data: newChange });
|
set({ data: newChange });
|
||||||
},
|
},
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue