Skip to content

Commit 5da11db

Browse files
committed
Fix connection tool use
1 parent 814b8d4 commit 5da11db

File tree

1 file changed

+14
-14
lines changed
  • typescript/packages/lookslike-prototype/src/components

1 file changed

+14
-14
lines changed

typescript/packages/lookslike-prototype/src/components/com-app.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,26 @@ export class ComApp extends LitElement {
5050
return JSON.stringify(this.graph);
5151
},
5252
addConnection: ({
53-
fromOutput,
54-
toInput
53+
from,
54+
to
5555
}: {
56-
fromOutput: string;
57-
toInput: NodePath;
56+
from: string;
57+
to: NodePath;
5858
}) => {
59-
console.log("addConnection", fromOutput, toInput);
60-
const [toNodeId, toInputKey] = toInput;
61-
const fromNode = graph.find((node) => node.id === fromOutput);
59+
console.log("addConnection", from, to);
60+
const [toNodeId, toInputKey] = to;
61+
const fromNode = graph.find((node) => node.id === from);
6262
if (!fromNode) {
63-
return `Node ${fromOutput} not found.\n${this.graphSnapshot()}`;
63+
return `Node ${from} not found.\n${this.graphSnapshot()}`;
6464
}
6565
const toNode = graph.find((node) => node.id === toNodeId);
6666
if (!toNode) {
6767
return `Node ${toNode} not found.\n${this.graphSnapshot()}`;
6868
}
6969

70-
toNode.in[toInputKey] = [".", fromOutput];
70+
toNode.in[toInputKey] = [".", from];
7171
updateGraph(graph);
72-
return `Added connection from ${fromOutput} to ${toInput}.\n${this.graphSnapshot()}`;
72+
return `Added connection from ${from} to ${to}.\n${this.graphSnapshot()}`;
7373
},
7474
addCodeNode: (props: { id: string; code: string }) => {
7575
console.log("addCodeNode", props);
@@ -343,10 +343,10 @@ export class ComApp extends LitElement {
343343
<com-unibox
344344
.suggestions=${watch(suggestions)}
345345
@suggested=${(ev) => {
346-
this.userInput = ev.detail.suggestion;
347-
this.appendMessage();
348-
suggestions.send([]);
349-
}}
346+
this.userInput = ev.detail.suggestion;
347+
this.appendMessage();
348+
suggestions.send([]);
349+
}}
350350
>
351351
<com-editor
352352
slot="main"

0 commit comments

Comments
 (0)