mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-12 06:22:31 +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
|
// Save current workflow automatically
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (document.visibilityState === "visible") {
|
if (document.hasFocus()) {
|
||||||
localStorage.setItem("workflow", JSON.stringify(this.graph.serialize()));
|
localStorage.setItem("workflow", JSON.stringify(this.graph.serialize()));
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@ -778,10 +778,8 @@ export class ComfyUI {
|
|||||||
this.is_launchTiming = true;
|
this.is_launchTiming = true;
|
||||||
|
|
||||||
this.switch_workflow_combo = document.getElementById("comfy-switch-workflow-combo");
|
this.switch_workflow_combo = document.getElementById("comfy-switch-workflow-combo");
|
||||||
document.addEventListener("visibilitychange", () => {
|
window.addEventListener("focus", () => {
|
||||||
if (document.visibilityState === "visible") {
|
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
||||||
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const id_renameWorkflow = "Comfy.RenameWorkflowDialog";
|
const id_renameWorkflow = "Comfy.RenameWorkflowDialog";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user