fix: can't switch back to single input value for :default property

https://linear.app/logseq/issue/LOG-2810/cant-switch-back-to-single-input-value-for-default-property
pull/10438/head
Tienson Qin 2023-09-13 14:04:45 +08:00
parent 73c5930672
commit 5cc4c4b676
3 changed files with 16 additions and 10 deletions

View File

@ -292,7 +292,8 @@
empty-block? (or (nil? parent) (zero? children-count))]
(when empty-block?
(when parent
(db/transact! repo [[:db/retractEntity (:db/id parent)]]))
(db/transact! repo [[:db/retractEntity (:db/id parent)]]
{:outliner-op :delete-blocks}))
(property-handler/delete-property-value! repo block (:block/uuid property) value))
(when (seq children)
[:div.property-block-container.w-full

View File

@ -353,8 +353,12 @@
:block/properties properties'
:block/refs refs}]
{:outliner-op :save-block}))
;; remove block property if cardinality is not many
(remove-block-property! repo (:block/uuid block) property-id))))))))
(if (= :default (get-in property [:block/schema :type]))
(set-block-property! repo (:block/uuid block)
(:block/original-name property)
""
{})
(remove-block-property! repo (:block/uuid block) property-id)))))))))
(defn replace-key-with-id!
"Notice: properties need to be created first"

View File

@ -28,6 +28,7 @@
(pipelines/invoke-hooks tx-report)
(when (or (:outliner/transact? tx-meta)
(:outliner-op tx-meta)
(:whiteboard/transact? tx-meta))
(undo-redo/listen-db-changes! tx-report))