mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 18:30:16 +01:00
This commit is contained in:
parent
25b8f08470
commit
77bd2634e1
4 changed files with 16 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {Constants} from "../constants";
|
||||
/// #if !BROWSER
|
||||
import {ipcRenderer} from "electron";
|
||||
import {getCurrentWindow} from "@electron/remote";
|
||||
/// #endif
|
||||
import {processMessage} from "./processMessage";
|
||||
import {kernelError} from "../dialog/processSystem";
|
||||
|
|
@ -48,7 +49,7 @@ export const fetchPost = (url: string, data?: any, cb?: (response: IWebSocketDat
|
|||
if (url === "/api/system/exit" || url === "/api/system/setWorkspaceDir" || (
|
||||
["/api/system/setUILayout"].includes(url) && data.exit // 内核中断,点关闭处理
|
||||
)) {
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT);
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, getCurrentWindow().id);
|
||||
}
|
||||
/// #endif
|
||||
});
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ const initWindow = () => {
|
|||
document.body.classList.add("body--blur");
|
||||
});
|
||||
ipcRenderer.on(Constants.SIYUAN_OPENURL, (event, url) => {
|
||||
console.log(event, url)
|
||||
if (!/^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue