From 021987290627cfb0ed7848d8825c309e6f826f73 Mon Sep 17 00:00:00 2001 From: PxTicks Date: Thu, 26 Feb 2026 16:49:20 +0000 Subject: [PATCH] Fix handleFile monkeypatch for new frontend signature (#2640) handleFile signature is updated in ComfyUI frontend [handleFile (file: File, openSource?: WorkflowOpenSource, options?: { deferWarnings?: boolean } )]. Using rest parameters to fix and future-proof. --- js/components-manager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/components-manager.js b/js/components-manager.js index 9244d2a4..8d4234ba 100644 --- a/js/components-manager.js +++ b/js/components-manager.js @@ -678,7 +678,7 @@ export class ComponentBuilderDialog extends ComfyDialog { let orig_handleFile = app.handleFile; -async function handleFile(file) { +async function handleFile(file, ...args) { if (file.name?.endsWith(".json") || file.name?.endsWith(".pack")) { const reader = new FileReader(); reader.onload = async () => { @@ -694,7 +694,7 @@ async function handleFile(file) { await handle_import_components(jsonContent); } else { - orig_handleFile.call(app, file); + orig_handleFile.call(app, file, ...args); } }; reader.readAsText(file); @@ -702,7 +702,7 @@ async function handleFile(file) { return; } - orig_handleFile.call(app, file); + orig_handleFile.call(app, file, ...args); } app.handleFile = handleFile;