Skip to content

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

:bug: Remove immediate lock on blur/visibilitychange, rely on cron idle timeout #18034

Daniela9d21d7cc9af
diff --git a/app/src/boot/globalEvent/event.ts b/app/src/boot/globalEvent/event.ts
index ea227d6a6b..8653d087f4 100644
--- a/app/src/boot/globalEvent/event.ts
+++ b/app/src/boot/globalEvent/event.ts
@@ -25,18 +25,9 @@ export const initWindowEvent = (app: App) => {
lastEncryptedNotebookTouch = now;
fetchPost("/api/notebook/touchEncryptedNotebooks", {});
};
- const lockEncryptedNotebooks = () => {
- fetchPost("/api/notebook/lockEncryptedNotebooks", {});
- };
window.addEventListener("pointerdown", touchEncryptedNotebooks, {passive: true});
window.addEventListener("keydown", touchEncryptedNotebooks);
document.addEventListener("touchstart", touchEncryptedNotebooks, {passive: true});
- window.addEventListener("blur", lockEncryptedNotebooks);
- document.addEventListener("visibilitychange", () => {
- if (document.hidden) {
- lockEncryptedNotebooks();
- }
- });
document.body.addEventListener("mouseleave", () => {
if (window.siyuan.layout.leftDock) {