Skip to content

Commit

Permalink
Merge pull request #2038 from neotyk/fix/copy-block-tree
Browse files Browse the repository at this point in the history
fix: make copy block tree great (again?)
  • Loading branch information
filipesilva committed Feb 23, 2022
2 parents bd0441c + 6f181e7 commit f7eddc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/cljc/athens/common_db.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@
(conj :node/title :page/sidebar)))


(defn get-block-document
"Fetches whole block and whole children"
[db id]
(->> (d/pull db block-document-pull-vector id)
sort-block-children))


(defn get-page-uid
"Finds page `:block/uid` by `page-title`."
[db page-title]
Expand Down
2 changes: 1 addition & 1 deletion src/cljs/athens/listeners.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
(let [uids @(subscribe [::select-subs/items])]
(when (not-empty uids)
(let [copy-data (->> uids
(map #(db/get-block [:block/uid %]))
(map #(common-db/get-block-document @db/dsdb [:block/uid %]))
(map #(blocks-to-clipboard-data 0 %))
(apply str))
clipboard-data (.. e -event_ -clipboardData)
Expand Down

0 comments on commit f7eddc2

Please sign in to comment.