Fix save temporary workflow loop on overwrite (#1699)

This commit is contained in:
Chenlei Hu
2024-11-26 07:44:25 -08:00
committed by GitHub
parent c977667a15
commit 46cd522384
2 changed files with 15 additions and 1 deletions

View File

@@ -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
}) => {

View File

@@ -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?`,