Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/services/workflowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,20 @@ export const useWorkflowService = () => {
* @param workflow The workflow to save
*/
const saveWorkflowAs = async (workflow: ComfyWorkflow) => {
const newFilename = await dialogService.prompt({
// Remove the basePath prefix from the path, since it never show to the user
const oldFileFullPath = (
workflow.directory +
'/' +
workflow.filename
).substring(ComfyWorkflow.basePath.length)
const newFileFullPath = await dialogService.prompt({
title: t('workflowService.saveWorkflow'),
message: t('workflowService.enterFilename') + ':',
defaultValue: workflow.filename
defaultValue: oldFileFullPath
})
if (!newFilename) return
if (!newFileFullPath) return

const newPath = workflow.directory + '/' + appendJsonExt(newFilename)
const newPath = ComfyWorkflow.basePath + appendJsonExt(newFileFullPath)
const newKey = newPath.substring(ComfyWorkflow.basePath.length)
const existingWorkflow = workflowStore.getWorkflowByPath(newPath)

Expand Down