pile changes if consecutively changing

This commit is contained in:
arnon-1 2023-10-10 22:03:09 +02:00
parent 901d210f06
commit af2b660125

View File

@ -1311,13 +1311,16 @@ export class ComfyApp {
this.loadGraphData();
}
this.changing = false // only used for administration for saved values for ctrl + Z
// Save current workflow automatically
setInterval(function(){
const previous_workflow = localStorage.getItem("workflow")
const workflow = JSON.stringify(this.graph.serialize())
if(previous_workflow !== workflow){
localStorage.setItem("ctrlZ", previous_workflow); // Save workflow for loading at ctrl + Z
}
if(!this.changing) localStorage.setItem("ctrlZ", previous_workflow); // Save workflow for loading at ctrl + Z
this.changing = truep
}else this.changing = false;
localStorage.setItem("workflow", workflow); // Save current workflow for loading at startup
},1000);