Skip to content

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

:recycle: https://github.com/siyuan-note/siyuan/issues/7123

Vanessa01a3a14ef63a
diff --git a/app/src/menus/navigation.ts b/app/src/menus/navigation.ts
index 503f2ed0c0..a80e637780 100644
--- a/app/src/menus/navigation.ts
+++ b/app/src/menus/navigation.ts
@@ -388,11 +388,19 @@ const genImportMenu = (notebookId: string, pathString: string) => {
formData.append("notebook", notebookId);
formData.append("toPath", pathString);
fetchPost("/api/import/importSY", formData, () => {
+ let files
/// #if MOBILE
- window.siyuan.mobile.files.selectItem(notebookId, pathString);
+ files = window.siyuan.mobile.files
/// #else
- (getDockByType("file").data["file"] as Files).selectItem(notebookId, pathString)
+ files = (getDockByType("file").data["file"] as Files);
/// #endif
+ const liElement = files.element.querySelector(`[data-path="${pathString}"]`)
+ const toggleElement = liElement.querySelector(".b3-list-item__arrow--open");
+ if (toggleElement) {
+ toggleElement.classList.remove("b3-list-item__arrow--open");
+ liElement.nextElementSibling?.remove();
+ }
+ files.getLeaf(liElement, notebookId);
window.siyuan.menus.menu.remove();
});
});
diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.ts
index 41c0cac2a7..48589424a7 100644
--- a/app/src/mobile/util/MobileFiles.ts
+++ b/app/src/mobile/util/MobileFiles.ts
@@ -649,7 +649,7 @@ export class MobileFiles extends Model {
}
}
- private getLeaf(liElement: Element, notebookId: string) {
+ public getLeaf(liElement: Element, notebookId: string) {
const toggleElement = liElement.querySelector(".b3-list-item__arrow");
if (toggleElement.classList.contains("b3-list-item__arrow--open")) {
toggleElement.classList.remove("b3-list-item__arrow--open");