mirror of https://github.com/logseq/logseq
fix: broken page when moving blocks
parent
fea174d661
commit
6407cd77ef
|
@ -152,7 +152,7 @@
|
|||
[db page-id {:keys [fix-parent-left? fix-broken-chain? replace-tx?]
|
||||
:or {fix-parent-left? true
|
||||
fix-broken-chain? true
|
||||
replace-tx? true}
|
||||
replace-tx? false}
|
||||
:as _opts}]
|
||||
(let [repo (state/get-current-repo)
|
||||
transact-opts (if replace-tx? {:replace? true} {})]
|
||||
|
|
|
@ -851,7 +851,8 @@
|
|||
:as opts}]
|
||||
[:pre [(seq blocks)
|
||||
(s/valid? ::block-map-or-entity target-block)]]
|
||||
(let [[target-block sibling?] (get-target-block target-block opts)
|
||||
(let [blocks (map (fn [b] (db/pull [:block/uuid (:block/uuid b)])) blocks)
|
||||
[target-block sibling?] (get-target-block target-block opts)
|
||||
non-consecutive-blocks? (seq (db-model/get-non-consecutive-blocks blocks))
|
||||
original-position? (move-to-original-position? blocks target-block sibling? non-consecutive-blocks?)]
|
||||
(when (and (not (contains? (set (map :db/id blocks)) (:db/id target-block)))
|
||||
|
|
Loading…
Reference in New Issue