mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-02 14:27:40 +00:00
[backport cloud/1.37] Fix asset selection in litegraph (#8119)
Backport of #8117 to `cloud/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8119-backport-cloud-1-37-Fix-asset-selection-in-litegraph-2eb6d73d3650811180a1e3f6779b4f60) by [Unito](https://www.unito.io) Co-authored-by: AustinMroz <austin@comfy.org>
This commit is contained in:
@@ -55,7 +55,7 @@ interface IWidgetKnobOptions extends IWidgetOptions<number[]> {
|
||||
}
|
||||
|
||||
export interface IWidgetAssetOptions extends IWidgetOptions {
|
||||
openModal: () => void
|
||||
openModal: (widget: IBaseWidget) => void
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,6 +53,6 @@ export class AssetWidget
|
||||
|
||||
override onClick() {
|
||||
//Open Modal
|
||||
this.options.openModal()
|
||||
this.options.openModal(this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ const createAssetBrowserWidget = (
|
||||
const displayLabel = currentValue ?? t('widgets.selectModel')
|
||||
const assetBrowserDialog = useAssetBrowserDialog()
|
||||
|
||||
async function openModal(this: IBaseWidget) {
|
||||
async function openModal(widget: IBaseWidget) {
|
||||
if (!isAssetWidget(widget)) {
|
||||
throw new Error(`Expected asset widget but received ${widget.type}`)
|
||||
}
|
||||
@@ -129,7 +129,7 @@ const createAssetBrowserWidget = (
|
||||
}
|
||||
|
||||
const oldValue = widget.value
|
||||
this.value = validatedFilename.data
|
||||
widget.value = validatedFilename.data
|
||||
node.onWidgetChanged?.(
|
||||
widget.name,
|
||||
validatedFilename.data,
|
||||
|
||||
Reference in New Issue
Block a user