[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

@@ -1,11 +1,16 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
import { ComfyWorkflow } from '@/scripts/workflows'
import { getStorageValue } from '@/scripts/utils'
export const useWorkflowStore = defineStore('workflow', () => {
const activeWorkflow = ref<ComfyWorkflow | null>(null)
const previousWorkflowUnsaved = ref<boolean>(
Boolean(getStorageValue('Comfy.PreviousWorkflowUnsaved'))
)
return {
activeWorkflow
activeWorkflow,
previousWorkflowUnsaved
}
})