fix: don't show "No property" when the value is not set yet

and there's a default value for this property.

fixes https://github.com/logseq/db-test/issues/517
This commit is contained in:
Tienson Qin
2025-10-22 22:03:00 +08:00
parent 9933813018
commit bf2d9dfd7c

View File

@@ -616,9 +616,13 @@
(not (and (ldb/class? block) (= (:db/ident property) :logseq.property.class/extends)))
(not= (:db/ident property) :logseq.property.view/type))
(concat sorted-items
[{:value clear-value
:label clear-value-label
:clear? true}])
(when-not (or (= (:logseq.property/default-value property)
(get block (:db/ident property)))
(= (:logseq.property/scalar-default-value property)
(get block (:db/ident property))))
[{:value clear-value
:label clear-value-label
:clear? true}]))
sorted-items)
(remove #(= :logseq.property/empty-placeholder (:value %))))
k :on-chosen