瀏覽代碼

:art: https://github.com/siyuan-note/siyuan/issues/6743

Vanessa 2 年之前
父節點
當前提交
32fb7e1882
共有 1 個文件被更改,包括 10 次插入10 次删除
  1. 10 10
      app/src/search/util.ts

+ 10 - 10
app/src/search/util.ts

@@ -212,17 +212,17 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
                 break;
             } else if (target.id === "searchPath") {
                 movePathTo((toPath, toNotebook) => {
-                    config.idPath = []
-                    const hPathList: string[] = []
-                    toPath.forEach((item, index) => {
-                        if (item === "/") {
-                            config.idPath.push(toNotebook[index])
-                            hPathList.push(escapeHtml(getNotebookName(toNotebook[index])))
-                        } else {
-                            config.idPath.push(pathPosix().join(toNotebook[index], item));
-                        }
-                    })
                     fetchPost("/api/filetree/getHPathsByPaths", {paths: toPath}, (response) => {
+                        config.idPath = []
+                        const hPathList: string[] = []
+                        toPath.forEach((item, index) => {
+                            if (item === "/") {
+                                config.idPath.push(toNotebook[index])
+                                hPathList.push(escapeHtml(getNotebookName(toNotebook[index])))
+                            } else {
+                                config.idPath.push(pathPosix().join(toNotebook[index], item));
+                            }
+                        })
                         if (response.data) {
                             hPathList.push(...response.data);
                         }