mirror of
https://github.com/marktext/marktext.git
synced 2025-05-04 08:29:18 +08:00
* bugfix: #338 error message on export cancel * fixed the solution * put package-lock.json back
This commit is contained in:
parent
1073e650cc
commit
1f0b65d95c
@ -20,24 +20,26 @@ const handleResponseForExport = (e, { type, content, pathname }) => {
|
|||||||
defaultPath
|
defaultPath
|
||||||
})
|
})
|
||||||
|
|
||||||
// If export PDF, the content will be undefined.
|
if (filePath) {
|
||||||
if (!content && type === 'pdf') {
|
// If export PDF, the content will be undefined.
|
||||||
win.webContents.printToPDF({ printBackground: true }, (err, data) => {
|
if (!content && type === 'pdf') {
|
||||||
if (err) log(err)
|
win.webContents.printToPDF({ printBackground: true }, (err, data) => {
|
||||||
else {
|
if (err) log(err)
|
||||||
writeFile(filePath, data, extension)
|
else {
|
||||||
.then(() => {
|
writeFile(filePath, data, extension)
|
||||||
win.webContents.send('AGANI::export-success', { type, filePath })
|
.then(() => {
|
||||||
})
|
win.webContents.send('AGANI::export-success', { type, filePath })
|
||||||
.catch(log)
|
})
|
||||||
}
|
.catch(log)
|
||||||
})
|
}
|
||||||
} else {
|
|
||||||
writeFile(filePath, content, extension)
|
|
||||||
.then(() => {
|
|
||||||
win.webContents.send('AGANI::export-success', { type, filePath })
|
|
||||||
})
|
})
|
||||||
.catch(log)
|
} else {
|
||||||
|
writeFile(filePath, content, extension)
|
||||||
|
.then(() => {
|
||||||
|
win.webContents.send('AGANI::export-success', { type, filePath })
|
||||||
|
})
|
||||||
|
.catch(log)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user