mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 21:42:37 +08:00
add comment
This commit is contained in:
parent
80e9544763
commit
7c91559e64
@ -1095,8 +1095,9 @@ export class ComfyApp {
|
|||||||
this.loadGraphData(workflow);
|
this.loadGraphData(workflow);
|
||||||
restored = true;
|
restored = true;
|
||||||
const workflow_id = localStorage.getItem("workflow_current_id");
|
const workflow_id = localStorage.getItem("workflow_current_id");
|
||||||
if (workflow_id)
|
if (workflow_id) {
|
||||||
this.workflow_current_id = workflow_id;
|
this.workflow_current_id = workflow_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error loading previous workflow", err);
|
console.error("Error loading previous workflow", err);
|
||||||
@ -1109,7 +1110,7 @@ export class ComfyApp {
|
|||||||
|
|
||||||
// Save current workflow automatically
|
// Save current workflow automatically
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
if (document.hasFocus()) {
|
if (document.hasFocus()) { // only workflow of the active browser tab in the active window
|
||||||
localStorage.setItem("workflow", JSON.stringify(this.graph.serialize()));
|
localStorage.setItem("workflow", JSON.stringify(this.graph.serialize()));
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@ -1610,7 +1611,7 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switchWorkflow(selected_id) {
|
switchWorkflow(selected_id) {
|
||||||
// If you change the value of this workflow_count, you also need to change the count of `$el("option"~` (ui.js).
|
// If you change the value of this workflow_count, you also need to change the count of `$el("option"~` (ui.js). (count up only)
|
||||||
const workflow_count = 10; // also used in getWorkflowNames function
|
const workflow_count = 10; // also used in getWorkflowNames function
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -779,6 +779,7 @@ export class ComfyUI {
|
|||||||
|
|
||||||
this.switch_workflow_combo = document.getElementById("comfy-switch-workflow-combo");
|
this.switch_workflow_combo = document.getElementById("comfy-switch-workflow-combo");
|
||||||
window.addEventListener("focus", () => {
|
window.addEventListener("focus", () => {
|
||||||
|
// to need to keep the workflow_current_id and selectedIndex to be the same value
|
||||||
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
localStorage.setItem("workflow_current_id", this.switch_workflow_combo.selectedIndex);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user