Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/services/workflowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/stores/workflowStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Loading