mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-03-07 18:17:36 +08:00
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.
This commit is contained in:
parent
60114405c1
commit
0219872906
@ -678,7 +678,7 @@ export class ComponentBuilderDialog extends ComfyDialog {
|
|||||||
|
|
||||||
let orig_handleFile = app.handleFile;
|
let orig_handleFile = app.handleFile;
|
||||||
|
|
||||||
async function handleFile(file) {
|
async function handleFile(file, ...args) {
|
||||||
if (file.name?.endsWith(".json") || file.name?.endsWith(".pack")) {
|
if (file.name?.endsWith(".json") || file.name?.endsWith(".pack")) {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onload = async () => {
|
reader.onload = async () => {
|
||||||
@ -694,7 +694,7 @@ async function handleFile(file) {
|
|||||||
await handle_import_components(jsonContent);
|
await handle_import_components(jsonContent);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
orig_handleFile.call(app, file);
|
orig_handleFile.call(app, file, ...args);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
reader.readAsText(file);
|
reader.readAsText(file);
|
||||||
@ -702,7 +702,7 @@ async function handleFile(file) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
orig_handleFile.call(app, file);
|
orig_handleFile.call(app, file, ...args);
|
||||||
}
|
}
|
||||||
|
|
||||||
app.handleFile = handleFile;
|
app.handleFile = handleFile;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user