Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/7854

Vanessa77f350a61cd1
diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.ts
index 61df9e53d5..09888dfdfc 100644
--- a/app/src/mobile/editor.ts
+++ b/app/src/mobile/editor.ts
@@ -45,7 +45,9 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL]) =
return;
}
if (window.siyuan.mobile.editor) {
- saveScroll(window.siyuan.mobile.editor.protyle);
+ if (document.getElementById("empty").classList.contains("fn__none")) {
+ saveScroll(window.siyuan.mobile.editor.protyle);
+ }
pushBack();
addLoading(window.siyuan.mobile.editor.protyle);
fetchPost("/api/filetree/getDoc", {
diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts
index 19d0338b8d..e027ea817d 100644
--- a/app/src/protyle/index.ts
+++ b/app/src/protyle/index.ts
@@ -25,6 +25,7 @@ import {Background} from "./header/Background";
import {disabledProtyle, enableProtyle, onGet} from "./util/onGet";
import {reloadProtyle} from "./util/reload";
import {renderBacklink} from "./wysiwyg/renderBacklink";
+import {setEmpty} from "../mobile/util/setEmpty";
export class Protyle {
@@ -149,13 +150,25 @@ export class Protyle {
}
break;
case "unmount":
- if (this.protyle.model && this.protyle.notebookId === data.data.box) {
- this.protyle.model.parent.parent.removeTab(this.protyle.model.parent.id, false, false);
+ if (this.protyle.notebookId === data.data.box) {
+ /// #if MOBILE
+ setEmpty();
+ /// #else
+ if (this.protyle.model) {
+ this.protyle.model.parent.parent.removeTab(this.protyle.model.parent.id, false, false);
+ }
+ /// #endif
}
break;
case "removeDoc":
- if (this.protyle.model && data.data.ids.includes(this.protyle.block.rootID)) {
- this.protyle.model.parent.parent.removeTab(this.protyle.model.parent.id, false, false);
+ if (data.data.ids.includes(this.protyle.block.rootID)) {
+ /// #if MOBILE
+ setEmpty();
+ /// #else
+ if (this.protyle.model) {
+ this.protyle.model.parent.parent.removeTab(this.protyle.model.parent.id, false, false);
+ }
+ /// #endif
}
break;
}