mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
Fix the display issue caused by inconsistent page order and dbid order of blocks
This commit is contained in:
@@ -990,7 +990,20 @@
|
||||
block (db/entity [:block/uuid (first ids)])]
|
||||
(when block
|
||||
(let [html (export-html/export-blocks-as-html repo top-level-block-uuids nil)
|
||||
copied-blocks (get-all-blocks-by-ids repo top-level-block-uuids)]
|
||||
copied-blocks (get-all-blocks-by-ids repo top-level-block-uuids)
|
||||
selected-blocks (dom/sel ".ls-block.selected.noselect")
|
||||
selected-block-ids (->> selected-blocks
|
||||
(reduce
|
||||
(fn [selected-block-ids selected-block]
|
||||
(let [selected-block-id (dom/attr selected-block "blockid")]
|
||||
(if (some #(= selected-block-id %) selected-block-ids)
|
||||
selected-block-ids
|
||||
(reduce #(conj %1 (dom/attr %2 "blockid"))
|
||||
(conj selected-block-ids selected-block-id)
|
||||
(seq (dom/by-class selected-block "ls-block"))))))
|
||||
[])
|
||||
(map uuid))
|
||||
copied-blocks (sort-by #(.indexOf selected-block-ids (:block/uuid %)) copied-blocks)]
|
||||
(common-handler/copy-to-clipboard-without-id-property! (:block/format block) content (when html? html) copied-blocks))
|
||||
(state/set-block-op-type! :copy)
|
||||
(notification/show! "Copied!" :success)))))
|
||||
|
||||
Reference in New Issue
Block a user