Skip to content

Commit

Permalink
Attempt to fix "retain value after template change" for SubgraphControl
Browse files Browse the repository at this point in the history
  • Loading branch information
yojeek committed Jan 6, 2024
1 parent 0865718 commit 281c036
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/renderer-vue/src/node/subgraphViewNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ export function updateSubgraphNodeInterfaces(node: AbstractGraphNode) {

const clone = cloneNodeInterface(targetNode, targetInterfaceKey);

if (existingInterface && existingInterface.value !== undefined) {
// attempt to restore interface value
try {
clone.value = existingInterface.value;
} catch (e : any) {
console.warn(`Could not set value for ${existingInterface.id}: ${e.message}`);
}
}

clone.name = subgraphInterfaceNode.inputs.name.value;

node.addInput(graphInput.id, clone.setPort(false));
Expand Down

0 comments on commit 281c036

Please sign in to comment.