diff options
Diffstat (limited to 'src/electron/ipc-api')
-rw-r--r-- | src/electron/ipc-api/download.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/electron/ipc-api/download.ts b/src/electron/ipc-api/download.ts index 518a7091c..851bff4c3 100644 --- a/src/electron/ipc-api/download.ts +++ b/src/electron/ipc-api/download.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; | 1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; |
2 | import { download } from 'electron-dl'; | 2 | import { download } from 'electron-dl'; |
3 | import mime from 'mime-types'; | ||
4 | import { writeFileSync } from 'fs-extra'; | 3 | import { writeFileSync } from 'fs-extra'; |
5 | import { PathLike } from 'fs'; | 4 | import { PathLike } from 'fs'; |
6 | 5 | ||
@@ -24,12 +23,9 @@ export default (params: { mainWindow: BrowserWindow }) => { | |||
24 | 23 | ||
25 | try { | 24 | try { |
26 | if (content) { | 25 | if (content) { |
27 | const extension = mime.extension(fileOptions.mime); | ||
28 | const filename = `${fileOptions.name}.${extension}`; | ||
29 | |||
30 | try { | 26 | try { |
31 | const saveDialog = await dialog.showSaveDialog(params.mainWindow, { | 27 | const saveDialog = await dialog.showSaveDialog(params.mainWindow, { |
32 | defaultPath: filename, | 28 | defaultPath: fileOptions.name, |
33 | }); | 29 | }); |
34 | 30 | ||
35 | if (saveDialog.canceled) return; | 31 | if (saveDialog.canceled) return; |