瀏覽代碼

fix: page-name unique check

Tienson Qin 2 年之前
父節點
當前提交
914b47f60b
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/main/frontend/handler/repo.cljs

+ 3 - 1
src/main/frontend/handler/repo.cljs

@@ -217,7 +217,9 @@
                           (assoc opts' :skip-db-transact? false)
                           opts')
                   result (parse-and-load-file! repo-url file opts')
-                  page-name (some (fn [x] (and (map? x) (:block/name x))) result)
+                  page-name (some (fn [x] (when (and (map? x) (:block/original-name x )
+                                                     (= (:file/path file) (:file/path (:block/file x))))
+                                            (:block/name x))) result)
                   page-exists? (and page-name (get @*page-names page-name))
                   tx' (cond
                         whiteboard? tx