mirror of
https://github.com/logseq/logseq.git
synced 2026-05-23 12:14:06 +00:00
enhance: don't update :block/updated-at when collapsing or expanding
This commit is contained in:
21
deps/outliner/src/logseq/outliner/core.cljs
vendored
21
deps/outliner/src/logseq/outliner/core.cljs
vendored
@@ -221,7 +221,7 @@
|
||||
|
||||
(extend-type Entity
|
||||
otree/INode
|
||||
(-save [this *txs-state db repo _date-formatter {:keys [retract-attributes? retract-attributes]
|
||||
(-save [this *txs-state db repo _date-formatter {:keys [retract-attributes? retract-attributes outliner-op]
|
||||
:or {retract-attributes? true}}]
|
||||
(assert (ds/outliner-txs-state? *txs-state)
|
||||
"db should be satisfied outliner-tx-state?")
|
||||
@@ -233,12 +233,16 @@
|
||||
data)
|
||||
db-based?
|
||||
(dissoc :block/properties))
|
||||
m* (-> data'
|
||||
(dissoc :block/children :block/meta :block/unordered
|
||||
:block.temp/ast-title :block.temp/ast-body :block/level :block.temp/fully-loaded?)
|
||||
common-util/remove-nils
|
||||
block-with-updated-at
|
||||
(fix-tag-ids db {:db-graph? db-based?}))
|
||||
collapse-or-expand? (= outliner-op :collapse-expand-blocks)
|
||||
m* (cond->
|
||||
(-> data'
|
||||
(dissoc :block/children :block/meta :block/unordered
|
||||
:block.temp/ast-title :block.temp/ast-body :block/level :block.temp/fully-loaded?)
|
||||
common-util/remove-nils
|
||||
|
||||
(fix-tag-ids db {:db-graph? db-based?}))
|
||||
(not collapse-or-expand?)
|
||||
block-with-updated-at)
|
||||
db-id (:db/id this)
|
||||
block-uuid (:block/uuid this)
|
||||
eid (or db-id (when block-uuid [:block/uuid block-uuid]))
|
||||
@@ -292,7 +296,8 @@
|
||||
retract-attributes)))))))
|
||||
|
||||
;; Update block's page attributes
|
||||
(update-page-when-save-block *txs-state block-entity m)
|
||||
(when-not collapse-or-expand?
|
||||
(update-page-when-save-block *txs-state block-entity m))
|
||||
;; Remove orphaned refs from block
|
||||
(when (and (:block/title m) (not= (:block/title m) (:block/title block-entity)))
|
||||
(remove-orphaned-refs-when-save db *txs-state block-entity m {:db-graph? db-based?})))
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
(def edit-block! block-handler/edit-block!)
|
||||
|
||||
(defn- outliner-save-block!
|
||||
[block]
|
||||
(outliner-op/save-block! block))
|
||||
[block & {:as opts}]
|
||||
(outliner-op/save-block! block opts))
|
||||
|
||||
(defn get-block-own-order-list-type
|
||||
[block]
|
||||
@@ -3642,7 +3642,7 @@
|
||||
(when-not (= current-value value)
|
||||
(let [block {:block/uuid block-id
|
||||
:block/collapsed? value}]
|
||||
(outliner-save-block! block)))))))
|
||||
(outliner-save-block! block {:outliner-op :collapse-expand-blocks})))))))
|
||||
(doseq [block-id block-ids]
|
||||
(state/set-collapsed-block! block-id value)))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user