mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
enhance: hide block refs count for blocks created in property
This commit is contained in:
@@ -2370,8 +2370,9 @@
|
||||
|
||||
(rum/defc block-refs-count < rum/static
|
||||
[block *hide-block-refs?]
|
||||
(let [block-refs-count (count (:block/_refs block))]
|
||||
(when (> block-refs-count 0)
|
||||
(let [created-in-property? (pu/get-property block :created-in-property)
|
||||
block-refs-count (count (:block/_refs block))]
|
||||
(when (and (not created-in-property?) (> block-refs-count 0))
|
||||
[:div
|
||||
[:a.open-block-ref-link.bg-base-2.text-sm.ml-2.fade-link
|
||||
{:title "Open block references"
|
||||
|
||||
@@ -236,12 +236,14 @@
|
||||
(let [repo (state/get-current-repo)
|
||||
content (string/trim (util/evalue e))]
|
||||
(when-not (string/blank? content)
|
||||
(let [new-block (-> (editor-handler/wrap-parse-block {:block/format :markdown
|
||||
(let [pid (:block/uuid (db/entity [:block/name "created-in-property"]))
|
||||
new-block (-> (editor-handler/wrap-parse-block {:block/format :markdown
|
||||
:block/content content})
|
||||
(outliner-core/block-with-timestamps)
|
||||
(assoc :block/page {:db/id
|
||||
(or (:db/id (:block/page block))
|
||||
(:db/id block))}))
|
||||
(merge {:block/page {:db/id
|
||||
(or (:db/id (:block/page block))
|
||||
(:db/id block))}
|
||||
:block/properties {pid true}}))
|
||||
id (:block/uuid new-block)]
|
||||
(db/transact! repo [new-block] {:outliner-op :insert-blocks})
|
||||
(add-property! block (:block/original-name property) id)
|
||||
|
||||
Reference in New Issue
Block a user