fixed https://github.com/logseq/db-test/issues/394
@@ -524,6 +524,8 @@
(defn- get-target-block-page
[target-block]
(or
+ (when (ldb/page? target-block)
+ (:db/id target-block))
(:db/id (:block/page target-block))
;; target parent is a page
(when-let [parent (:block/parent target-block)]
@@ -330,10 +330,14 @@
(:custom-query? config))
(not (:ref-query-child? config)))
has-children? (db/has-children? (:block/uuid current-block))
+ library? (:library? config)
sibling? (cond
ref-query-top-block?
false
+ (and library? (ldb/page? current-block))
+ true
+
(boolean? sibling?)
sibling?
@@ -342,7 +346,6 @@
:else
(not has-children?))
- library? (:library? config)
new-block' (if library?
(-> new-block
(-> (assoc :block/tags #{:logseq.class/Page}