mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
Update state when graph cleared via UI (#88)
This commit is contained in:
@@ -160,6 +160,10 @@ export class ChangeTracker {
|
||||
changeTracker().checkState();
|
||||
});
|
||||
|
||||
api.addEventListener("graphCleared", () => {
|
||||
changeTracker().checkState();
|
||||
});
|
||||
|
||||
// Handle litegraph clicks
|
||||
// @ts-ignore
|
||||
const processMouseUp = LGraphCanvas.prototype.processMouseUp;
|
||||
|
||||
@@ -706,6 +706,7 @@ export class ComfyUI {
|
||||
app.clean();
|
||||
app.graph.clear();
|
||||
app.resetView();
|
||||
api.dispatchEvent(new CustomEvent("graphCleared"));
|
||||
}
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user