Browse Source

fix: page-name unique check

Tienson Qin 2 years ago
parent
commit
914b47f60b
1 changed files with 3 additions and 1 deletions
  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