mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 21:42:37 +08:00
Fixed a bug that occurred when working on workflows in more than one window.
This commit is contained in:
parent
46db5de0f4
commit
80e9544763
@ -1109,7 +1109,7 @@ export class ComfyApp {
|
||||
|
||||
// Save current workflow automatically
|
||||
setInterval(() => {
|
||||
if (document.visibilityState === "visible") {
|
||||
if (document.hasFocus()) {
|
||||
localStorage.setItem("workflow", JSON.stringify(this.graph.serialize()));
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
@ -778,10 +778,8 @@ export class ComfyUI {
|
||||
this.is_launchTiming = true;
|
||||
|
||||
this.switch_workflow_combo = document.getElementById("comfy-switch-workflow-combo");
|
||||
document.addEventListener("visibilitychange", () => {
|
||||
if (document.visibilityState === "visible") {
|
||||
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
||||
}
|
||||
window.addEventListener("focus", () => {
|
||||
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
||||
});
|
||||
|
||||
const id_renameWorkflow = "Comfy.RenameWorkflowDialog";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user