From 7e33530a8d7cb30fb9fef2c48cba97e5bb88d73c Mon Sep 17 00:00:00 2001 From: Vijay Aravamudhan Date: Sat, 27 May 2023 21:51:11 +0530 Subject: Add new context menu item to download images (#935) --- src/electron/ipc-api/download.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/electron/ipc-api/download.ts') 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 @@ import { ipcMain, dialog, BrowserWindow } from 'electron'; import { download } from 'electron-dl'; -import mime from 'mime-types'; import { writeFileSync } from 'fs-extra'; import { PathLike } from 'fs'; @@ -24,12 +23,9 @@ export default (params: { mainWindow: BrowserWindow }) => { try { if (content) { - const extension = mime.extension(fileOptions.mime); - const filename = `${fileOptions.name}.${extension}`; - try { const saveDialog = await dialog.showSaveDialog(params.mainWindow, { - defaultPath: filename, + defaultPath: fileOptions.name, }); if (saveDialog.canceled) return; -- cgit v1.2.3-54-g00ecf