mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
This commit is contained in:
parent
f781d2d183
commit
62a7a36d3c
5 changed files with 8 additions and 4 deletions
|
|
@ -1260,7 +1260,7 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
|||
return;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) {
|
||||
lockScreen();
|
||||
lockScreen(app);
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,10 +130,13 @@ export const reloadSync = (app: App, data: { upsertRootIDs: string[], removeRoot
|
|||
/// #endif
|
||||
};
|
||||
|
||||
export const lockScreen = () => {
|
||||
export const lockScreen = (app: App) => {
|
||||
if (window.siyuan.config.readonly) {
|
||||
return;
|
||||
}
|
||||
app.plugins.forEach(item => {
|
||||
item.eventBus.emit("lock-screen");
|
||||
});
|
||||
/// #if BROWSER
|
||||
fetchPost("/api/system/logoutAuth", {}, () => {
|
||||
redirectToCheckAuth();
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ export const workspaceMenu = (app: App, rect: DOMRect) => {
|
|||
icon: "iconLock",
|
||||
accelerator: window.siyuan.config.keymap.general.lockScreen.custom,
|
||||
click: () => {
|
||||
lockScreen();
|
||||
lockScreen(app);
|
||||
}
|
||||
}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ export const initRightMenu = (app: App) => {
|
|||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "menuLock") {
|
||||
lockScreen();
|
||||
lockScreen(app);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -63,6 +63,7 @@ type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
|||
"loaded-protyle" | "loaded-protyle-dynamic" | "loaded-protyle-static" |
|
||||
"switch-protyle" |
|
||||
"destroy-protyle" |
|
||||
"lock-screen" |
|
||||
"mobile-keyboard-show" | "mobile-keyboard-hide"
|
||||
type TAVCol =
|
||||
"text"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue