Commit 40a37777 authored by Farid Safi's avatar Farid Safi
Browse files

move clean to handleFile and loadGraphData functions

parent 39308487
......@@ -721,6 +721,8 @@ class ComfyApp {
* @param {*} graphData A serialized graph object
*/
loadGraphData(graphData) {
this.clean();
if (!graphData) {
graphData = defaultGraph;
}
......
......@@ -306,7 +306,6 @@ export class ComfyUI {
style: { display: "none" },
parent: document.body,
onchange: () => {
app.clean();
app.handleFile(fileInput.files[0]);
},
});
......@@ -393,10 +392,7 @@ export class ComfyUI {
app.clean();
app.graph.clear();
}}),
$el("button", { textContent: "Load Default", onclick: () => {
app.clean();
app.loadGraphData();
}}),
$el("button", { textContent: "Load Default", onclick: () => app.loadGraphData() }),
]);
dragElement(this.menuContainer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment