From 20006eafa8022010d2473521425fc765fe0c498b Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 19 Apr 2024 20:16:39 +0800 Subject: [PATCH] fix: update :block/page when moving between pages --- deps/outliner/src/logseq/outliner/core.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/core.cljs b/deps/outliner/src/logseq/outliner/core.cljs index 6fe1eb8c1..ca54a1293 100644 --- a/deps/outliner/src/logseq/outliner/core.cljs +++ b/deps/outliner/src/logseq/outliner/core.cljs @@ -1023,12 +1023,15 @@ first-block-page (:db/id (:block/page block)) target-page (or (:db/id (:block/page target-block)) (:db/id target-block)) - tx-data [{:db/id (:db/id block) - :block/left (:db/id target-block) - :block/parent (if sibling? - (:db/id (:block/parent target-block)) - (:db/id target-block))}] not-same-page? (not= first-block-page target-page) + tx-data [(cond-> + {:db/id (:db/id block) + :block/left (:db/id target-block) + :block/parent (if sibling? + (:db/id (:block/parent target-block)) + (:db/id target-block))} + not-same-page? + (assoc :block/page target-page))] move-blocks-next-tx (build-move-block-next-tx db block target-block sibling?) children-page-tx (when not-same-page? (let [children-ids (ldb/get-block-children-ids db (:block/uuid block))]