This commit is contained in:
Vanessa 2022-09-09 09:45:18 +08:00
parent 270565bb6c
commit 2be531a0cc
3 changed files with 12 additions and 12 deletions

View file

@ -350,7 +350,7 @@ export const about = {
const downloadInstallPkgElement = about.element.querySelector("#downloadInstallPkg") as HTMLInputElement; const downloadInstallPkgElement = about.element.querySelector("#downloadInstallPkg") as HTMLInputElement;
downloadInstallPkgElement.addEventListener("change", () => { downloadInstallPkgElement.addEventListener("change", () => {
fetchPost("/api/system/setDownloadInstallPkg", {downloadInstallPkg: downloadInstallPkgElement.checked}, () => { fetchPost("/api/system/setDownloadInstallPkg", {downloadInstallPkg: downloadInstallPkgElement.checked}, () => {
window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked;
}); });
}); });
about.element.querySelector("#aboutConfim").addEventListener("click", () => { about.element.querySelector("#aboutConfim").addEventListener("click", () => {

View file

@ -122,7 +122,7 @@ export const exitSiYuan = () => {
ipcRenderer.send(Constants.SIYUAN_QUIT); ipcRenderer.send(Constants.SIYUAN_QUIT);
/// #endif /// #endif
}); });
}) });
} else { // 正常退出 } else { // 正常退出
/// #if !BROWSER /// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY); ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY);

View file

@ -82,8 +82,8 @@ const renderPDF = (id: string) => {
show: true, show: true,
width: 1032, width: 1032,
resizable: false, resizable: false,
frame: 'darwin' === window.siyuan.config.system.os, frame: "darwin" === window.siyuan.config.system.os,
titleBarStyle: 'hidden', titleBarStyle: "hidden",
webPreferences: { webPreferences: {
contextIsolation: false, contextIsolation: false,
nodeIntegration: true, nodeIntegration: true,
@ -142,20 +142,20 @@ const renderPDF = (id: string) => {
} }
}); });
}); });
destroyWin(win) destroyWin(win);
}).catch((error: string) => { }).catch((error: string) => {
showMessage("Export PDF error:" + error, 0, "error", msgId); showMessage("Export PDF error:" + error, 0, "error", msgId);
destroyWin(win) destroyWin(win);
}); });
} catch (e) { } catch (e) {
showMessage("Export PDF error:" + e + ". Export HTML and use Chrome's printing function to convert to PDF", 0, "error", msgId); showMessage("Export PDF error:" + e + ". Export HTML and use Chrome's printing function to convert to PDF", 0, "error", msgId);
destroyWin(win) destroyWin(win);
} }
} else { } else {
destroyWin(win) destroyWin(win);
} }
}) });
}) });
fetchPost("/api/export/exportPreviewHTML", { fetchPost("/api/export/exportPreviewHTML", {
id, id,
}, response => { }, response => {
@ -386,8 +386,8 @@ const renderPDF = (id: string) => {
}); });
</script></body></html>`; </script></body></html>`;
win.loadURL("data:text/html;charset=UTF-8," + encodeURIComponent(html)); win.loadURL("data:text/html;charset=UTF-8," + encodeURIComponent(html));
}) });
} };
const getExportPath = (option: { type: string, id: string }, removeAssets?: boolean) => { const getExportPath = (option: { type: string, id: string }, removeAssets?: boolean) => {
fetchPost("/api/block/getBlockInfo", { fetchPost("/api/block/getBlockInfo", {