Fix duplication of persisted workflow (#2124)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2025-01-02 12:16:39 -05:00
committed by GitHub
parent bb988edf9f
commit 9c1eacf0af
15 changed files with 70 additions and 2 deletions

View File

@@ -21,8 +21,9 @@ import { useWorkspaceStore } from '@/stores/workspaceStore'
export function useCoreCommands(): ComfyCommand[] {
const workflowService = useWorkflowService()
const workflowStore = useWorkflowStore()
const dialogService = useDialogService()
const getTracker = () => useWorkflowStore()?.activeWorkflow?.changeTracker
const getTracker = () => workflowStore.activeWorkflow?.changeTracker
const getSelectedNodes = (): LGraphNode[] => {
const selectedNodes = app.canvas.selected_nodes
@@ -512,6 +513,15 @@ export function useCoreCommands(): ComfyCommand[] {
function: () => {
dialogService.showSettingsDialog('about')
}
},
{
id: 'Comfy.DuplicateWorkflow',
icon: 'pi pi-clone',
label: 'Duplicate Current Workflow',
versionAdded: '1.6.15',
function: () => {
workflowService.duplicateWorkflow(workflowStore.activeWorkflow!)
}
}
]
}