Replace window.dialog with prompt dialog in workflows.ts (#1138)

This commit is contained in:
Chenlei Hu
2024-10-06 19:31:46 -04:00
committed by GitHub
parent c7aabecc0e
commit 8c156cc651

View File

@@ -13,6 +13,7 @@ import { useExecutionStore } from '@/stores/executionStore'
import { markRaw, toRaw } from 'vue'
import { UserDataFullInfo } from '@/types/apiTypes'
import { useToastStore } from '@/stores/toastStore'
import { showPromptDialog } from '@/services/dialogService'
export class ComfyWorkflowManager extends EventTarget {
executionStore: ReturnType<typeof useExecutionStore> | null
@@ -369,10 +370,11 @@ export class ComfyWorkflow {
private async _save(path: string | null, overwrite: boolean) {
if (!path) {
path = prompt(
'Save workflow as:',
trimJsonExt(this.path) ?? this.name ?? 'workflow'
)
path = await showPromptDialog({
title: 'Save workflow',
message: 'Enter the filename:',
defaultValue: trimJsonExt(this.path) ?? this.name ?? 'workflow'
})
if (!path) return
}