Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-10-13 20:14:13 +08:00
commit b387c7d1fb
5 changed files with 12 additions and 6 deletions

View file

@ -773,7 +773,12 @@ app.whenReady().then(() => {
return systemPreferences.askForMediaAccess("microphone");
}
if (data.cmd === "printToPDF") {
return getWindowByContentId(data.webContentsId).webContents.printToPDF(data.pdfOptions);
try {
return getWindowByContentId(data.webContentsId).webContents.printToPDF(data.pdfOptions);
} catch (e) {
writeLog(e);
throw e;
}
}
if (data.cmd === "siyuan-open-file") {
let hasMatch = false;

View file

@ -334,6 +334,7 @@ ${response.data.replace("%pages", "<span class=totalPages></span>").replace("%pa
});
});
} catch (e) {
console.error(e);
showMessage("Export PDF failed: " + e, 0, "error", msgId);
ipcRenderer.send(Constants.SIYUAN_CMD, {cmd: "destroy", webContentsId: ipcData.webContentsId});
}

File diff suppressed because one or more lines are too long