Skip to content

Commit

Permalink
Fix validity check so that output types are grabbed like sources
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxTretikov committed Jul 5, 2024
1 parent f91cee4 commit 367abbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions components/node/sd-node/node-handle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ export const NodeHandle = ({
if (connection.targetHandle === "*" || connection.sourceHandle === "*")
return true;
try {
let targetType = nodes.find((n) => n.id === connection.target)?.data
.input.required[String(connection.targetHandle)][0];
if (isArray(targetType)) targetType = "STRING";
const sourceType = connection.sourceHandle;
const findType = (id: string | null, handle: string | null) => {
const type = nodes.find((n) => n.id === id)?.data.input.required[String(handle)][0];
return isArray(type) ? "STRING" : type;
}
const targetType = findType(connection.target, connection.targetHandle);
const sourceType = findType(connection.source, connection.sourceHandle);
return targetType === sourceType;
} catch {
return true;
Expand Down
1 change: 0 additions & 1 deletion components/node/sd-node/node-outputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface NodeOutputsProps {

const NodeOutputsComponent = ({ data, selected }: NodeOutputsProps) => {
if (!data?.length) return <div />;
// console.log(data);
return (
<div className="flex-1">
{data.map(({ name, type }, i) => (
Expand Down

0 comments on commit 367abbb

Please sign in to comment.