mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Don't prompt unsaved when there is no unsaved workflow on window close (#2257)
This commit is contained in:
@@ -13,11 +13,16 @@
|
||||
import { onBeforeUnmount, onMounted } from 'vue'
|
||||
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { useWorkflowStore } from '@/stores/workflowStore'
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
const workflowStore = useWorkflowStore()
|
||||
|
||||
const handleBeforeUnload = (event: BeforeUnloadEvent) => {
|
||||
if (settingStore.get('Comfy.Window.UnloadConfirmation')) {
|
||||
if (
|
||||
settingStore.get('Comfy.Window.UnloadConfirmation') &&
|
||||
workflowStore.modifiedWorkflows.length > 0
|
||||
) {
|
||||
event.preventDefault()
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user