mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-27 17:52:16 +00:00
[Refactor] Remove app.getWidgetType (#2880)
This commit is contained in:
@@ -2,6 +2,10 @@ import { defineStore } from 'pinia'
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
import type { InputSpec as InputSpecV2 } from '@/schemas/nodeDef/nodeDefSchemaV2'
|
||||
import {
|
||||
type InputSpec as InputSpecV1,
|
||||
getInputSpecType
|
||||
} from '@/schemas/nodeDefSchema'
|
||||
import { ComfyWidgetConstructor, ComfyWidgets } from '@/scripts/widgets'
|
||||
|
||||
export const useWidgetStore = defineStore('widget', () => {
|
||||
@@ -12,8 +16,9 @@ export const useWidgetStore = defineStore('widget', () => {
|
||||
...coreWidgets
|
||||
}))
|
||||
|
||||
function inputIsWidget(spec: InputSpecV2) {
|
||||
return spec.type in widgets.value
|
||||
function inputIsWidget(spec: InputSpecV2 | InputSpecV1) {
|
||||
const type = Array.isArray(spec) ? getInputSpecType(spec) : spec.type
|
||||
return type in widgets.value
|
||||
}
|
||||
|
||||
function registerCustomWidgets(
|
||||
|
||||
Reference in New Issue
Block a user