Update state when graph cleared via UI (#88)

This commit is contained in:
bymyself
2024-07-05 10:28:39 -07:00
committed by GitHub
parent c4b6c9f63e
commit 27c5bc1581
3 changed files with 7 additions and 0 deletions

View File

@@ -160,6 +160,10 @@ export class ChangeTracker {
changeTracker().checkState();
});
api.addEventListener("graphCleared", () => {
changeTracker().checkState();
});
// Handle litegraph clicks
// @ts-ignore
const processMouseUp = LGraphCanvas.prototype.processMouseUp;

View File

@@ -706,6 +706,7 @@ export class ComfyUI {
app.clean();
app.graph.clear();
app.resetView();
api.dispatchEvent(new CustomEvent("graphCleared"));
}
},
}),

View File

@@ -1,5 +1,6 @@
// @ts-nocheck
import { api } from "../../api";
import { $el } from "../../ui";
import { downloadBlob } from "../../utils";
import { ComfyButton } from "../components/button";
@@ -112,6 +113,7 @@ export class ComfyAppMenu {
) {
app.clean();
app.graph.clear();
api.dispatchEvent(new CustomEvent("graphCleared"));
}
},
})