Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Supports `Follow system lock screen` on mobile https://github.com/siyuan-note/siyuan/issues/17625

Danielcadff4aae291
diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts
index be16917bcf..52e81e5a6e 100644
--- a/app/src/mobile/index.ts
+++ b/app/src/mobile/index.ts
@@ -16,7 +16,7 @@ import {handleTouchEnd, handleTouchMove, handleTouchStart} from "./util/touch";
import {fetchGet, fetchPost} from "../util/fetch";
import {initFramework} from "./util/initFramework";
import {initAssets, loadAssets} from "../util/assets";
-import {bootSync} from "../dialog/processSystem";
+import {bootSync, lockScreen} from "../dialog/processSystem";
import {initMessage, showMessage} from "../dialog/message";
import {goBack} from "./util/MobileBackFoward";
import {activeBlur, hideKeyboardToolbar, showKeyboardToolbar} from "./util/keyboardToolbar";
@@ -218,6 +218,11 @@ window.reconnectWebSocket = () => {
window.siyuan.mobile.editor.protyle.ws.send("ping", {});
window.siyuan.mobile.popEditor?.protyle.ws.send("ping", {});
};
+window.lockscreenByMode = () => {
+ if (window.siyuan.config.system.lockScreenMode === 1) {
+ lockScreen(siyuanApp);
+ }
+};
window.goBack = goBack;
window.showMessage = showMessage;
window.processIOSPurchaseResponse = processIOSPurchaseResponse;
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 5147a9fdd3..dfe2128095 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -296,6 +296,8 @@ interface Window {
Protyle: import("../protyle/method").default;
+ lockscreenByMode(): void;
+
goBack(): void;
showMessage(message: string, timeout: number, type: string, messageId?: string): void;