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/5144

Vanessa76fd4c280a47
diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.ts
index fae7f3f868..e1cf297a49 100644
--- a/app/src/mobile/util/MobileFiles.ts
+++ b/app/src/mobile/util/MobileFiles.ts
@@ -499,6 +499,10 @@ export class MobileFiles extends Model {
} else {
targetElement.remove();
}
+
+ if (window.siyuan.mobileEditor && window.siyuan.mobileEditor.protyle.path === data.data.path) {
+ setEmpty();
+ }
}
}
diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.ts
index f056ecb49c..482638da08 100644
--- a/app/src/util/newFile.ts
+++ b/app/src/util/newFile.ts
@@ -7,6 +7,8 @@ import {fetchPost} from "./fetch";
import {getDisplayName, getOpenNotebookCount, pathPosix} from "./pathName";
import {openFileById} from "../editor/util";
import {Constants} from "../constants";
+import {isMobile} from "./functions";
+import {openMobileFileById} from "../mobile/editor";
export const newFile = (notebookId?: string, currentPath?: string, open?: boolean) => {
if (getOpenNotebookCount() === 0) {
@@ -57,7 +59,11 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea
md: "",
}, () => {
if (open) {
- openFileById({id, hasContext: true, action: [Constants.CB_GET_HL]});
+ if (isMobile()) {
+ openMobileFileById(id, true);
+ } else {
+ openFileById({id, hasContext: true, action: [Constants.CB_GET_HL]});
+ }
}
});
});