Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
javizqh committed Sep 26, 2024
1 parent 2ebe1a6 commit 41041d3
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions frontend/src/components/diagram_editor/DiagramEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ const addDefaultPorts = (node: any, model: any) => {
});
};

const deletePortLink = (model:any, portName: string, node: BasicNodeModel) => {
var link: LinkModel | undefined;
const nodePort = node.getPort(portName);

if (nodePort) {
link = Object.values(nodePort.links)[0];
if (link) {
model.current.removeLink(link);
}
const deletePortLink = (model: any, portName: string, node: BasicNodeModel) => {
var link: LinkModel | undefined;
const nodePort = node.getPort(portName);

if (nodePort) {
link = Object.values(nodePort.links)[0];
if (link) {
model.current.removeLink(link);
}
}
}
};

const isActionNode = (node: any) => {
var name = node.getName();
Expand Down Expand Up @@ -257,7 +257,10 @@ const DiagramEditorModalsWrapper = memo(
//TODO: for the tags, this will never be called. Maybe have a common type
if (currentNode instanceof BasicNodeModel) {
var convNode = node as BasicNodeModel;
if (convNode.getName() === currentNode.getName() && currentNode !== convNode) {
if (
convNode.getName() === currentNode.getName() &&
currentNode !== convNode
) {
convNode.setColor(currentNode.getColor());
}
}
Expand Down Expand Up @@ -510,7 +513,7 @@ const DiagramEditorModalsWrapper = memo(
return;
}

deletePortLink(model, port.options.name, node)
deletePortLink(model, port.options.name, node);

if (type === 0) {
node.removeInputPort(port);
Expand All @@ -523,7 +526,10 @@ const DiagramEditorModalsWrapper = memo(
//TODO: for the tags, this will never be called. Maybe have a common type
if (isActionNode(oldNode)) {
var convNode = oldNode as BasicNodeModel;
if (convNode.getName() === node.getName() && node.getID() !== convNode.getID()) {
if (
convNode.getName() === node.getName() &&
node.getID() !== convNode.getID()
) {
deletePortLink(model, port.options.name, convNode);

if (type === 0) {
Expand Down

0 comments on commit 41041d3

Please sign in to comment.