mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 08:00:21 +00:00
Generate a new workflow id when using "save as" (#3407)
This commit is contained in:
@@ -94,10 +94,14 @@ export const useWorkflowService = () => {
|
||||
await renameWorkflow(workflow, newPath)
|
||||
await workflowStore.saveWorkflow(workflow)
|
||||
} else {
|
||||
const tempWorkflow = workflowStore.createTemporary(
|
||||
newKey,
|
||||
workflow.activeState as ComfyWorkflowJSON
|
||||
)
|
||||
// Generate new id when saving existing workflow as a new file
|
||||
const id = crypto.randomUUID()
|
||||
const state = JSON.parse(
|
||||
JSON.stringify(workflow.activeState)
|
||||
) as ComfyWorkflowJSON
|
||||
state.id = id
|
||||
|
||||
const tempWorkflow = workflowStore.createTemporary(newKey, state)
|
||||
await openWorkflow(tempWorkflow)
|
||||
await workflowStore.saveWorkflow(tempWorkflow)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user