[Refactor] Convert workflowService to composable (#2057)

This commit is contained in:
Chenlei Hu
2024-12-26 00:11:27 -05:00
committed by GitHub
parent c00d665aa5
commit 4e554503c0
8 changed files with 119 additions and 101 deletions

View File

@@ -33,7 +33,7 @@ import { ComfyWorkflow } from '@/stores/workflowStore'
import { useWorkflowStore } from '@/stores/workflowStore'
import Button from 'primevue/button'
import { ref } from 'vue'
import { workflowService } from '@/services/workflowService'
import { useWorkflowService } from '@/services/workflowService'
import { useWorkspaceStore } from '@/stores/workspaceStore'
import { usePragmaticDraggable, usePragmaticDroppable } from '@/hooks/dndHooks'
@@ -54,7 +54,7 @@ const workflowTabRef = ref<HTMLElement | null>(null)
const closeWorkflows = async (options: WorkflowOption[]) => {
for (const opt of options) {
if (
!(await workflowService.closeWorkflow(opt.workflow, {
!(await useWorkflowService().closeWorkflow(opt.workflow, {
warnIfUnsaved: !workspaceStore.shiftDown
}))
) {