mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 08:30:06 +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)
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ export const useWorkflowStore = defineStore('workflow', () => {
|
||||
getWorkflowByPath,
|
||||
syncWorkflows
|
||||
}
|
||||
}) as unknown as () => WorkflowStore
|
||||
}) as () => WorkflowStore
|
||||
|
||||
export const useWorkflowBookmarkStore = defineStore('workflowBookmark', () => {
|
||||
const bookmarks = ref<Set<string>>(new Set())
|
||||
|
||||
Reference in New Issue
Block a user