Vanessa 2023-01-04 23:03:08 +08:00
parent a99cb898c4
commit 910a600d5d
12 changed files with 400 additions and 388 deletions

View file

@ -93,7 +93,6 @@ export const exitSiYuan = () => {
buttonElement.addEventListener("click", () => {
fetchPost("/api/system/exit", {force: true}, () => {
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY);
ipcRenderer.send(Constants.SIYUAN_QUIT);
/// #else
if (["ios", "android"].includes(window.siyuan.config.system.container) && (window.webkit?.messageHandlers || window.JSAndroid)) {
@ -118,7 +117,6 @@ export const exitSiYuan = () => {
}, 2000);
// 然后等待一段时间后再退出,避免界面主进程退出以后内核子进程被杀死
setTimeout(() => {
ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY);
ipcRenderer.send(Constants.SIYUAN_QUIT);
}, 4000);
/// #endif
@ -129,14 +127,12 @@ export const exitSiYuan = () => {
execInstallPkg: 1 // 0默认检查新版本1不执行新版本安装2执行新版本安装
}, () => {
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY);
ipcRenderer.send(Constants.SIYUAN_QUIT);
/// #endif
});
});
} else { // 正常退出
/// #if !BROWSER
ipcRenderer.send(Constants.SIYUAN_CONFIG_CLOSETRAY);
ipcRenderer.send(Constants.SIYUAN_QUIT);
/// #else
if (["ios", "android"].includes(window.siyuan.config.system.container) && (window.webkit?.messageHandlers || window.JSAndroid)) {