mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
fix: saveAndWait must also wait for isTemporary to become false
The share dialog's refreshDialogState() checks workflow.isTemporary — if true, it shows 'unsaved' state. After saving a temporary workflow, the backend response updates size (making isTemporary false), but the test was only waiting for isModified === false, creating a race where the dialog could open before the workflow was fully persisted.
This commit is contained in:
@@ -109,11 +109,13 @@ async function saveAndWait(
|
||||
): Promise<void> {
|
||||
await comfyPage.menu.topbar.saveWorkflow(workflowName)
|
||||
await comfyPage.page.waitForFunction(
|
||||
() =>
|
||||
(window.app!.extensionManager as WorkspaceStore).workflow.activeWorkflow
|
||||
?.isModified === false,
|
||||
() => {
|
||||
const wf = (window.app!.extensionManager as WorkspaceStore).workflow
|
||||
.activeWorkflow
|
||||
return wf !== null && !wf.isTemporary && !wf.isModified
|
||||
},
|
||||
undefined,
|
||||
{ timeout: 3000 }
|
||||
{ timeout: 5000 }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user