From 8c156cc651b3fd841931e620d5e2ffddce8316d7 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sun, 6 Oct 2024 19:31:46 -0400 Subject: [PATCH] Replace window.dialog with prompt dialog in workflows.ts (#1138) --- src/scripts/workflows.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/scripts/workflows.ts b/src/scripts/workflows.ts index 65c77ba5d..bdc557334 100644 --- a/src/scripts/workflows.ts +++ b/src/scripts/workflows.ts @@ -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 | 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 }