mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-24 08:44:06 +00:00
[Refactor] Convert dialogService to composable (#2058)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { t } from '@/i18n'
|
||||
import { app } from '@/scripts/app'
|
||||
import { showConfirmationDialog } from '@/services/dialogService'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
;(async () => {
|
||||
if (!isElectron()) return
|
||||
@@ -114,7 +114,7 @@ import { electronAPI as getElectronAPI, isElectron } from '@/utils/envUtil'
|
||||
label: 'Reinstall',
|
||||
icon: 'pi pi-refresh',
|
||||
async function() {
|
||||
const proceed = await showConfirmationDialog({
|
||||
const proceed = await useDialogService().showConfirmationDialog({
|
||||
message: t('desktopMenu.confirmReinstall'),
|
||||
title: t('desktopMenu.reinstall'),
|
||||
type: 'reinstall'
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
serialise
|
||||
} from '@/extensions/core/vintageClipboard'
|
||||
import type { ComfyNodeDef } from '@/types/apiTypes'
|
||||
import { showPromptDialog } from '@/services/dialogService'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import { t } from '@/i18n'
|
||||
|
||||
type GroupNodeWorkflowData = {
|
||||
@@ -80,7 +80,7 @@ class GroupNodeBuilder {
|
||||
}
|
||||
|
||||
async getName() {
|
||||
const name = await showPromptDialog({
|
||||
const name = await useDialogService().showPromptDialog({
|
||||
title: t('groupNode.create'),
|
||||
message: t('groupNode.enterName'),
|
||||
defaultValue: ''
|
||||
|
||||
@@ -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: ''
|
||||
|
||||
Reference in New Issue
Block a user