[Refactor] Convert dialogService to composable (#2058)

This commit is contained in:
Chenlei Hu
2024-12-26 00:26:01 -05:00
committed by GitHub
parent 4e554503c0
commit f69e88bf41
8 changed files with 176 additions and 171 deletions

View File

@@ -6,7 +6,7 @@ import { GroupNodeConfig, GroupNodeHandler } from './groupNode'
import { LGraphCanvas } from '@comfyorg/litegraph'
import { useToastStore } from '@/stores/toastStore'
import { deserialiseAndCreate } from '@/extensions/core/vintageClipboard'
import { showPromptDialog } from '@/services/dialogService'
import { useDialogService } from '@/services/dialogService'
import { t } from '@/i18n'
// Adds the ability to save and add multiple nodes as a template
@@ -351,7 +351,7 @@ app.registerExtension({
content: `Save Selected as Template`,
disabled: !Object.keys(app.canvas.selected_nodes || {}).length,
callback: async () => {
const name = await showPromptDialog({
const name = await useDialogService().showPromptDialog({
title: t('nodeTemplates.saveAsTemplate'),
message: t('nodeTemplates.enterName'),
defaultValue: ''