mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-03-06 09:37:32 +08:00
Fix handleFile monkeypatch for new frontend signature
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
c88a9985c1
commit
3ca18bf204
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user