Only persist workflow on workflow change/switch (#1576)

* Only persist workflow on workflow change/switch

* nit

* Add playwright test

* Add modify test

* nit

* Fix playwright tests

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-11-17 14:13:52 -05:00
committed by GitHub
parent 16b0ebf75a
commit 71e4a42cfe
9 changed files with 53 additions and 21 deletions

View File

@@ -1865,15 +1865,6 @@ export class ComfyApp {
await this.loadGraphData()
}
// Save current workflow automatically
setInterval(() => {
const workflow = JSON.stringify(this.serializeGraph())
localStorage.setItem('workflow', workflow)
if (api.clientId) {
sessionStorage.setItem(`workflow:${api.clientId}`, workflow)
}
}, 1000)
this.#addDrawNodeHandler()
this.#addDrawGroupsHandler()
this.#addDropHandler()