[Beta Menu] Shows unsaved state on browser tab title (#860)

* [Beta Menu] Shows unsaved state on browser tab title

* Proper state management

* Add playwright test

* Fix browser tests
This commit is contained in:
Chenlei Hu
2024-09-17 16:14:06 +09:00
committed by GitHub
parent e8daebdc0c
commit 4e41db2d6a
7 changed files with 106 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ import { ComfyAsyncDialog } from '../components/asyncDialog'
import { trimJsonExt } from '@/utils/formatUtil'
import type { ComfyApp } from '@/scripts/app'
import type { ComfyComponent } from '../components'
import { useWorkflowStore } from '@/stores/workflowStore'
export class ComfyWorkflowsMenu {
#first = true
@@ -68,7 +69,11 @@ export class ComfyWorkflowsMenu {
this.unsaved = prop(this, 'unsaved', classList.unsaved, (v) => {
classList.unsaved = v
this.button.classList = classList
setStorageValue('Comfy.PreviousWorkflowUnsaved', v)
setStorageValue('Comfy.PreviousWorkflowUnsaved', String(v))
if (this.app.vueAppReady) {
useWorkflowStore().previousWorkflowUnsaved = v
}
})
}