Skip to content
Merged
Prev Previous commit
Next Next commit
Update src/scripts/app.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
christian-byrne and coderabbitai[bot] authored Dec 13, 2025
commit d56242326e11b57ee5cc0a3401ad51b3c4761a7c
2 changes: 2 additions & 0 deletions src/scripts/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,7 @@
if (!_.isObject(data) || Array.isArray(data)) {
return false
}
if (Object.keys(data).length === 0) return false

return Object.values(data).every((node) => {
if (!node || typeof node !== 'object' || Array.isArray(node)) {
Expand All @@ -1514,8 +1515,9 @@
return typeof classType === 'string' && inputsIsRecord
})
}
}

loadApiJson(apiData: ComfyApiWorkflow, fileName: string) {

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

';' expected.

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

',' expected.

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

',' expected.

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

';' expected.

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

',' expected.

Check failure on line 1520 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

',' expected.
useWorkflowService().beforeLoadNewGraph()

const missingNodeTypes = Object.values(apiData).filter(
Expand Down Expand Up @@ -1625,7 +1627,7 @@
* Registers a Comfy web extension with the app
* @param {ComfyExtension} extension
*/
registerExtension(extension: ComfyExtension) {

Check failure on line 1630 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

';' expected.

Check failure on line 1630 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

',' expected.

Check failure on line 1630 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

';' expected.

Check failure on line 1630 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

',' expected.
useExtensionService().registerExtension(extension)
}

Expand All @@ -1634,7 +1636,7 @@
* @param canvas The canvas instance
* @returns Array of context menu items from all extensions
*/
collectCanvasMenuItems(canvas: LGraphCanvas): IContextMenuValue[] {

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

';' expected.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

An element access expression should take an argument.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

';' expected.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

',' expected.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

';' expected.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

An element access expression should take an argument.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

';' expected.

Check failure on line 1639 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

',' expected.
return useExtensionService()
.invokeExtensions('getCanvasMenuItems', canvas)
.flat() as IContextMenuValue[]
Expand All @@ -1645,7 +1647,7 @@
* @param node The node being right-clicked
* @returns Array of context menu items from all extensions
*/
collectNodeMenuItems(node: LGraphNode): IContextMenuValue[] {

Check failure on line 1650 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / collect

',' expected.

Check failure on line 1650 in src/scripts/app.ts

View workflow job for this annotation

GitHub Actions / setup

',' expected.
return useExtensionService()
.invokeExtensions('getNodeMenuItems', node)
.flat() as IContextMenuValue[]
Expand Down
Loading