mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
07d5a6cd2f
commit
b524a3c72f
3 changed files with 27 additions and 30 deletions
|
|
@ -111,7 +111,7 @@ export const exitSiYuan = () => {
|
|||
buttonElement.addEventListener("click", () => {
|
||||
fetchPost("/api/system/exit", {force: true}, () => {
|
||||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, getCurrentWindow().id);
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #else
|
||||
if (["ios", "android"].includes(window.siyuan.config.system.container) && (window.webkit?.messageHandlers || window.JSAndroid)) {
|
||||
window.location.href = "siyuan://api/system/exit";
|
||||
|
|
@ -135,7 +135,7 @@ export const exitSiYuan = () => {
|
|||
}, 2000);
|
||||
// 然后等待一段时间后再退出,避免界面主进程退出以后内核子进程被杀死
|
||||
setTimeout(() => {
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, getCurrentWindow().id);
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
}, 4000);
|
||||
/// #endif
|
||||
});
|
||||
|
|
@ -145,13 +145,13 @@ export const exitSiYuan = () => {
|
|||
execInstallPkg: 1 // 0:默认检查新版本,1:不执行新版本安装,2:执行新版本安装
|
||||
}, () => {
|
||||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, getCurrentWindow().id);
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #endif
|
||||
});
|
||||
});
|
||||
} else { // 正常退出
|
||||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, getCurrentWindow().id);
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #else
|
||||
if (["ios", "android"].includes(window.siyuan.config.system.container) && (window.webkit?.messageHandlers || window.JSAndroid)) {
|
||||
window.location.href = "siyuan://api/system/exit";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue