[ISSUE 197] bug fixed
This commit is contained in:
parent
ba07dc585e
commit
e2e34800a0
|
@ -600,12 +600,21 @@ ipcMain.on(
|
|||
ipcMain.on(
|
||||
FileChannel.SelectSaveFilePath,
|
||||
(event: IpcMainEvent, ...args: any[]) => {
|
||||
const defaultPath = args[0];
|
||||
const ext = path.extname(defaultPath);
|
||||
dialog
|
||||
.showSaveDialog({ defaultPath: args[0] })
|
||||
.showSaveDialog({
|
||||
defaultPath
|
||||
})
|
||||
.then(obj => {
|
||||
const filePath =
|
||||
'' !== ext && '' === path.extname(obj.filePath)
|
||||
? `${obj.filePath}${ext}`
|
||||
: obj.filePath;
|
||||
|
||||
event.returnValue = {
|
||||
canceled: obj.canceled,
|
||||
filePath: obj.filePath
|
||||
filePath
|
||||
};
|
||||
})
|
||||
.catch(obj => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user