File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
deps/db/src/logseq/db/common Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 2626(defn- build-retracted-tx
2727 [retracted-blocks]
2828 (let [refs (->> (mapcat (fn [block] (:block/_refs block)) retracted-blocks)
29- (common-util/distinct-by :db/id ))]
29+ (common-util/distinct-by :db/id ))
30+ retract-ids (set (map :db/id retracted-blocks))]
3031 (mapcat
3132 (fn [ref]
3233 (let [id (:db/id ref)
33- replaced-title (when-let [raw-title (:block/raw-title ref)]
34- (reduce
35- (fn [raw-title block]
36- (replace-ref-with-deleted-block-title block raw-title))
37- raw-title
38- retracted-blocks))
34+ replaced-title (when-not (contains? retract-ids id)
35+ (when-let [raw-title (:block/raw-title ref)]
36+ (reduce
37+ (fn [raw-title block]
38+ (replace-ref-with-deleted-block-title block raw-title))
39+ raw-title
40+ retracted-blocks)))
3941 tx (cond->
4042 (mapcat
4143 (fn [block]
You can’t perform that action at this time.
0 commit comments