mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
04f47749f7
commit
22a926946c
5 changed files with 23 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import {openSearch} from "../search/spread";
|
||||
import {exportLayout, JSONToLayout, resetLayout, resizeDrag, resizeTabs} from "../layout/util";
|
||||
import {exportLayout, getInstanceById, JSONToLayout, resetLayout, resizeDrag, resizeTabs} from "../layout/util";
|
||||
import {hotKey2Electron, setStorageVal, updateHotkeyTip} from "../protyle/util/compatibility";
|
||||
/// #if !BROWSER
|
||||
import {dialog, getCurrentWindow} from "@electron/remote";
|
||||
|
|
@ -30,6 +30,7 @@ import {replaceLocalPath} from "../editor/rename";
|
|||
import {workspaceMenu} from "../menus/workspace";
|
||||
import {getWorkspaceName} from "./noRelyPCFunction";
|
||||
import {setTabPosition} from "../window/setHeader";
|
||||
import { Tab } from "../layout/Tab";
|
||||
|
||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||
if (key1 === "general") {
|
||||
|
|
@ -355,6 +356,12 @@ export const initWindow = () => {
|
|||
winOnClose(currentWindow, close);
|
||||
});
|
||||
}
|
||||
ipcRenderer.on(Constants.SIYUAN_CLOSETAB, (e, ipcData) => {
|
||||
const tab = getInstanceById(ipcData);
|
||||
if (tab && tab instanceof Tab) {
|
||||
tab.parent.removeTab(ipcData);
|
||||
}
|
||||
});
|
||||
ipcRenderer.on(Constants.SIYUAN_LOCK_SCREEN, () => {
|
||||
exportLayout(false, () => {
|
||||
fetchPost("/api/system/logoutAuth", {}, () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue