Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/17760

Vanessa4fa3956b9036
diff --git a/app/src/mobile/util/keydown.ts b/app/src/mobile/util/keydown.ts
index 86406ec6c7..7f2b5ac150 100644
--- a/app/src/mobile/util/keydown.ts
+++ b/app/src/mobile/util/keydown.ts
@@ -9,10 +9,12 @@ export const mobileKeydown = (app: App, event: KeyboardEvent) => {
if (!event.key || filterHotkey(event, app)) {
return;
}
- const protyle = getCurrentEditor().protyle;
const matchGeneral = Object.keys(window.siyuan.config.keymap.general).find((key) => {
if (matchHotKey(window.siyuan.config.keymap.general[key].custom, event)) {
- execByCommand({command: key, app, protyle, previousRange: protyle.toolbar.range});
+ const protyle = getCurrentEditor()?.protyle;
+ if (protyle) {
+ execByCommand({command: key, app, protyle, previousRange: protyle.toolbar.range});
+ }
return true;
}
});
diff --git a/app/src/mobile/util/touch.ts b/app/src/mobile/util/touch.ts
index b082a2fc2c..5cbcf0b28e 100644
--- a/app/src/mobile/util/touch.ts
+++ b/app/src/mobile/util/touch.ts
@@ -78,7 +78,7 @@ export const handleTouchEnd = (event: TouchEvent) => {
}
}
- if (typeof yDiff === "undefined" && window.siyuan.mobile.editor.protyle.options.render.gutter) {
+ if (typeof yDiff === "undefined" && window.siyuan.mobile.editor?.protyle.options.render.gutter) {
const nodeElement = hasClosestBlock(target);
if (nodeElement) {
if (nodeElement && (nodeElement.classList.contains("list") || nodeElement.classList.contains("li"))) {