mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
fix: editing block should be property instead of its parent block
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
[frontend.handler.route :as route-handler]
|
||||
[frontend.handler.db-based.editor :as db-editor-handler]
|
||||
[frontend.handler.file-based.editor :as file-editor-handler]
|
||||
[frontend.handler.property :as property-handler]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.modules.outliner.core :as outliner-core]
|
||||
[frontend.modules.outliner.transaction :as outliner-tx]
|
||||
@@ -1162,17 +1161,13 @@
|
||||
|
||||
(defn save-block-aux!
|
||||
[block value opts]
|
||||
(let [entity (db/entity [:block/uuid (:block/uuid block)])
|
||||
editing-property (:ui/editing-property @state/state)]
|
||||
(when (:db/id entity)
|
||||
(let [entity (db/entity [:block/uuid (:block/uuid block)])]
|
||||
(when (and (:db/id entity)
|
||||
(not (contains? #{"property"} (:block/type entity))))
|
||||
(let [value (string/trim value)]
|
||||
(if editing-property
|
||||
(property-handler/add-property! (state/get-current-repo) entity
|
||||
(:block/name editing-property)
|
||||
value)
|
||||
;; FIXME: somehow frontend.components.editor's will-unmount event will loop forever
|
||||
;; maybe we shouldn't save the block/file in "will-unmount" event?
|
||||
(save-block-if-changed! block value opts))))))
|
||||
;; FIXME: somehow frontend.components.editor's will-unmount event will loop forever
|
||||
;; maybe we shouldn't save the block/file in "will-unmount" event?
|
||||
(save-block-if-changed! block value opts)))))
|
||||
|
||||
(defn save-block!
|
||||
([repo block-or-uuid content]
|
||||
|
||||
Reference in New Issue
Block a user