mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 01:20:09 +00:00
fix: remove redundant guard and export VueWidgets type
- Remove nested if check in getCustomVueWidgets registration by capturing method reference before async IIFE - Export VueWidgets type for use by external extension code
This commit is contained in:
@@ -82,11 +82,10 @@ export const useExtensionService = () => {
|
||||
}
|
||||
|
||||
if (extension.getCustomVueWidgets) {
|
||||
const getVueWidgets = extension.getCustomVueWidgets
|
||||
void (async () => {
|
||||
if (extension.getCustomVueWidgets) {
|
||||
const vueWidgets = await extension.getCustomVueWidgets(app)
|
||||
registerVueWidgets(vueWidgets)
|
||||
}
|
||||
const vueWidgets = await getVueWidgets(app)
|
||||
registerVueWidgets(vueWidgets)
|
||||
})()
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface VueWidgetDefinition {
|
||||
aliases?: string[]
|
||||
}
|
||||
|
||||
type VueWidgets = Record<string, VueWidgetDefinition>
|
||||
export type VueWidgets = Record<string, VueWidgetDefinition>
|
||||
|
||||
export interface AboutPageBadge {
|
||||
label: string
|
||||
|
||||
Reference in New Issue
Block a user