Skip to content

Commit 671e33c

Browse files
authored
Fix asset browser on subgraph nodes (#6240)
When a widget is linked to a subgraph, the subgraph creates a copy of the widget. The callback used by the asset browser to update the widget still refers to the widget that lives inside the subgraph, but at time of execution, this is overwritten by the unchanged value of the copy. This is fixed by instead updating the value of the caller. It's a little hacky, and may need future review. See also #6237 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6240-Fix-asset-browser-on-subgraph-nodes-2956d73d365081b49bd1cd1a7a254763) by [Unito](https://www.unito.io)
1 parent 68f98e2 commit 671e33c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/extensions/vueNodes/widgets/composables/useComboWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const addComboWidget = (
7676
'asset',
7777
inputSpec.name,
7878
displayLabel,
79-
async () => {
79+
async function (this: IBaseWidget) {
8080
if (!isAssetWidget(widget)) {
8181
throw new Error(`Expected asset widget but received ${widget.type}`)
8282
}
@@ -111,7 +111,7 @@ const addComboWidget = (
111111
}
112112

113113
const oldValue = widget.value
114-
widget.value = validatedFilename.data
114+
this.value = validatedFilename.data
115115
node.onWidgetChanged?.(
116116
widget.name,
117117
validatedFilename.data,

0 commit comments

Comments
 (0)