diff --git a/src/backend/browser/fileImpl.ts b/src/backend/browser/fileImpl.ts index 4df490efce..9b5c5e3728 100644 --- a/src/backend/browser/fileImpl.ts +++ b/src/backend/browser/fileImpl.ts @@ -243,13 +243,13 @@ export const readFileImpl = async (filePath: string) => { // 返り値はファイルパスではなく、疑似パスを返す export const showExportFilePickerImpl: (typeof window)[typeof SandboxKey]["showExportFileDialog"] = async (obj: { - defaultName?: string; + defaultPath?: string; extensionName: string; extensions: string[]; title: string; }) => { const handle = await showSaveFilePicker({ - suggestedName: obj.defaultName, + suggestedName: obj.defaultPath, types: [ { description: obj.extensions.join("、"), diff --git a/src/backend/browser/sandbox.ts b/src/backend/browser/sandbox.ts index 87876e2893..f2fda877d2 100644 --- a/src/backend/browser/sandbox.ts +++ b/src/backend/browser/sandbox.ts @@ -137,7 +137,7 @@ export const api: Sandbox = { return fileHandle?.[0]; }, async showExportFileDialog(obj: { - defaultName?: string; + defaultPath?: string; extensionName: string; extensions: string[]; title: string; diff --git a/src/backend/electron/main.ts b/src/backend/electron/main.ts index 6c9ee5a42e..be092f8a26 100644 --- a/src/backend/electron/main.ts +++ b/src/backend/electron/main.ts @@ -573,12 +573,12 @@ registerIpcMainHandle({ SHOW_EXPORT_FILE_DIALOG: async ( _, - { title, defaultName, extensionName, extensions }, + { title, defaultPath, extensionName, extensions }, ) => { const result = await retryShowSaveDialogWhileSafeDir(() => dialog.showSaveDialog(win, { title, - defaultPath: defaultName, + defaultPath, filters: [{ name: extensionName, extensions: extensions }], properties: ["createDirectory"], }), diff --git a/src/backend/electron/preload.ts b/src/backend/electron/preload.ts index 72d7768e27..878c8f6448 100644 --- a/src/backend/electron/preload.ts +++ b/src/backend/electron/preload.ts @@ -64,10 +64,10 @@ const api: Sandbox = { }); }, - showExportFileDialog: ({ title, defaultName, extensionName, extensions }) => { + showExportFileDialog: ({ title, defaultPath, extensionName, extensions }) => { return ipcRendererInvokeProxy.SHOW_EXPORT_FILE_DIALOG({ title, - defaultName, + defaultPath, extensionName, extensions, }); diff --git a/src/store/audio.ts b/src/store/audio.ts index 31aceaae07..d433b55ef6 100644 --- a/src/store/audio.ts +++ b/src/store/audio.ts @@ -1372,7 +1372,7 @@ export const audioStore = createPartialStore({ } else { filePath ??= await window.backend.showExportFileDialog({ title: "音声を保存", - defaultName: defaultAudioFileName, + defaultPath: defaultAudioFileName, extensionName: "WAV ファイル", extensions: ["wav"], }); @@ -1521,7 +1521,7 @@ export const audioStore = createPartialStore({ } else { filePath ??= await window.backend.showExportFileDialog({ title: "音声を全て繋げて保存", - defaultName: defaultFileName, + defaultPath: defaultFileName, extensionName: "WAV ファイル", extensions: ["wav"], }); @@ -1666,7 +1666,7 @@ export const audioStore = createPartialStore({ } else { filePath ??= await window.backend.showExportFileDialog({ title: "文章を全て繋げてテキストファイルに保存", - defaultName: defaultFileName, + defaultPath: defaultFileName, extensionName: "テキストファイル", extensions: ["txt"], }); diff --git a/src/store/singing.ts b/src/store/singing.ts index 30899f89d3..82be06deb4 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -2770,7 +2770,7 @@ export const singingStore = createPartialStore({ } else { filePath ??= await window.backend.showExportFileDialog({ title: "音声を保存", - defaultName: fileName, + defaultPath: fileName, extensions: ["wav"], extensionName: "WAV ファイル", }); @@ -3532,7 +3532,7 @@ export const singingStore = createPartialStore({ let filePath = await window.backend.showExportFileDialog({ title: "プロジェクトを書き出し", - defaultName: fileBaseName, + defaultPath: fileBaseName, extensionName: fileTypeLabel, extensions: [extension], }); diff --git a/src/type/ipc.ts b/src/type/ipc.ts index 11ffed2ced..c0abc26d97 100644 --- a/src/type/ipc.ts +++ b/src/type/ipc.ts @@ -57,7 +57,7 @@ export type IpcIHData = { args: [ obj: { title: string; - defaultName?: string; + defaultPath?: string; extensionName: string; extensions: string[]; }, diff --git a/src/type/preload.ts b/src/type/preload.ts index 743a7afa14..24c8f4d6db 100644 --- a/src/type/preload.ts +++ b/src/type/preload.ts @@ -91,7 +91,7 @@ export interface Sandbox { }): Promise; showExportFileDialog(obj: { title: string; - defaultName?: string; + defaultPath?: string; extensionName: string; extensions: string[]; }): Promise;