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