mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Fix save temporary workflow loop on overwrite (#1699)
This commit is contained in:
@@ -465,6 +465,20 @@ test.describe('Menu', () => {
|
||||
).toEqual(['workflow5.json'])
|
||||
})
|
||||
|
||||
test('Can save temporary workflow with unmodified name', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
expect(await comfyPage.isCurrentWorkflowModified()).toBe(false)
|
||||
|
||||
await comfyPage.menu.topbar.saveWorkflow('Unsaved Workflow')
|
||||
// Should not trigger the overwrite dialog
|
||||
expect(
|
||||
await comfyPage.page.locator('.comfy-modal-content:visible').count()
|
||||
).toBe(0)
|
||||
|
||||
expect(await comfyPage.isCurrentWorkflowModified()).toBe(false)
|
||||
})
|
||||
|
||||
test('Can overwrite other workflows with save as', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
|
||||
@@ -66,7 +66,7 @@ export const workflowService = {
|
||||
const workflowStore = useWorkflowStore()
|
||||
const existingWorkflow = workflowStore.getWorkflowByPath(newPath)
|
||||
|
||||
if (existingWorkflow) {
|
||||
if (existingWorkflow && !existingWorkflow.isTemporary) {
|
||||
const res = (await ComfyAsyncDialog.prompt({
|
||||
title: 'Overwrite existing file?',
|
||||
message: `"${newPath}" already exists. Do you want to overwrite it?`,
|
||||
|
||||
Reference in New Issue
Block a user