فهرست منبع

fix: can't create alias property for file based graph

Tienson Qin 1 سال پیش
والد
کامیت
c7827ee268
2فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 3 1
      deps/graph-parser/src/logseq/graph_parser/block.cljs
  2. 3 2
      src/main/frontend/handler/file_based/editor.cljs

+ 3 - 1
deps/graph-parser/src/logseq/graph_parser/block.cljs

@@ -152,7 +152,9 @@
            (remove (into #{}
            (remove (into #{}
                          (map name)
                          (map name)
                          (apply conj
                          (apply conj
-                                (gp-property/editable-built-in-properties)
+                                (apply disj
+                                       (gp-property/editable-built-in-properties)
+                                       gp-property/editable-linkable-built-in-properties)
                                 (gp-property/hidden-built-in-properties))))
                                 (gp-property/hidden-built-in-properties))))
            (distinct))
            (distinct))
      properties)
      properties)

+ 3 - 2
src/main/frontend/handler/file_based/editor.cljs

@@ -71,10 +71,11 @@
     value))
     value))
 
 
 (defn wrap-parse-block
 (defn wrap-parse-block
-  [{:block/keys [content format page uuid level pre-block?] :as block
+  [{:block/keys [content format uuid level pre-block?] :as block
     :or {format :markdown}}]
     :or {format :markdown}}]
   (let [repo (state/get-current-repo)
   (let [repo (state/get-current-repo)
         block (or (and (:db/id block) (db/pull (:db/id block))) block)
         block (or (and (:db/id block) (db/pull (:db/id block))) block)
+        page (:block/page block)
         block (merge block
         block (merge block
                      (block/parse-title-and-body uuid format pre-block? (:block/content block)))
                      (block/parse-title-and-body uuid format pre-block? (:block/content block)))
         properties (:block/properties block)
         properties (:block/properties block)
@@ -88,7 +89,7 @@
                   content)
                   content)
         content (drawer/with-logbook block content)
         content (drawer/with-logbook block content)
         content (with-timetracking block content)
         content (with-timetracking block content)
-        first-block? (= (:block/uuid (ldb/get-first-child (db/get-db) page))
+        first-block? (= (:block/uuid (ldb/get-first-child (db/get-db) (:db/id page)))
                         (:block/uuid block))
                         (:block/uuid block))
         ast (mldoc/->edn (string/trim content) format)
         ast (mldoc/->edn (string/trim content) format)
         first-elem-type (first (ffirst ast))
         first-elem-type (first (ffirst ast))