fix: paste text instead of blocks when copied from another graph

Related to LOG-3123
This commit is contained in:
Tienson Qin
2024-06-05 21:51:08 +08:00
parent 23b6d0745a
commit 9c955081ab
3 changed files with 11 additions and 7 deletions

View File

@@ -826,12 +826,15 @@
#?(:cljs
(defn copy-to-clipboard!
[text & {:keys [html blocks owner-window]}]
[text & {:keys [graph html blocks owner-window]}]
(let [data (clj->js
(common-util/remove-nils-non-nested
{:text text
:html html
:blocks (when (seq blocks) (pr-str (mapv #(dissoc % :block.temp/fully-loaded? %) blocks)))}))]
:blocks (when (and graph (seq blocks))
(pr-str
{:graph graph
:blocks (mapv #(dissoc % :block.temp/fully-loaded? %) blocks)}))}))]
(if owner-window
(utils/writeClipboard data owner-window)
(utils/writeClipboard data)))))