Remove unused import and fix formatting in IOOutputView, MenuBar, RenameLabel, and PageComponent

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-20 16:07:32 -03:00
commit 8376cd1a5b
4 changed files with 8 additions and 20 deletions

View file

@ -1,4 +1,3 @@
import { cloneDeep } from "lodash";
import useFlowStore from "../../stores/flowStore";
import { IOOutputProps } from "../../types/components";
import { Textarea } from "../ui/textarea";

View file

@ -41,17 +41,15 @@ export const MenuBar = ({
function handleAddFlow(duplicate?: boolean) {
try {
if(duplicate) {
if (duplicate) {
if (!currentFlow) {
throw new Error("No flow to duplicate");
}
addFlow(true, currentFlow).then((id) => {
setSuccessData({title:"Flow duplicated successfully"});
setSuccessData({ title: "Flow duplicated successfully" });
navigate("/flow/" + id);
});
}
else
{
} else {
addFlow(true).then((id) => {
navigate("/flow/" + id);
});

View file

@ -29,7 +29,7 @@ export default function RenameLabel(props) {
}
resizeInput();
return () => {
if(isRename) document.removeEventListener("keydown", () => {});
if (isRename) document.removeEventListener("keydown", () => {});
};
}, [isRename]);

View file

@ -104,29 +104,20 @@ export default function Page({
) {
event.preventDefault();
takeSnapshot();
if (
validateSelection(lastSelection!, edges).length === 0
) {
if (validateSelection(lastSelection!, edges).length === 0) {
const { newFlow, removedEdges } = generateFlow(
lastSelection!,
nodes,
edges,
getRandomName()
);
const newGroupNode = generateNodeFromFlow(
newFlow,
getNodeId
);
const newEdges = reconnectEdges(
newGroupNode,
removedEdges
);
const newGroupNode = generateNodeFromFlow(newFlow, getNodeId);
const newEdges = reconnectEdges(newGroupNode, removedEdges);
setNodes((oldNodes) => [
...oldNodes.filter(
(oldNodes) =>
!lastSelection?.nodes.some(
(selectionNode) =>
selectionNode.id === oldNodes.id
(selectionNode) => selectionNode.id === oldNodes.id
)
),
newGroupNode,