Skip to content

Commit

Permalink
chore: remove unnecessary :copy/blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin authored and andelf committed Mar 29, 2023
1 parent bc635ea commit 4351213
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,6 @@
(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)]
(common-handler/copy-to-clipboard-without-id-property! (:block/format block) content (when html? html) copied-blocks))
;; (state/set-copied-blocks! content (get-all-blocks-by-ids repo top-level-block-uuids))
(notification/show! "Copied!" :success)))))

(defn copy-block-refs
Expand Down Expand Up @@ -1229,7 +1228,6 @@
[_top-level-block-uuids md-content] (compose-copied-blocks-contents repo [block-id])
html (export-html/export-blocks-as-html repo [block-id] nil)
sorted-blocks (tree/get-sorted-block-and-children repo (:db/id block))]
;; (state/set-copied-blocks! md-content sorted-blocks)
(common-handler/copy-to-clipboard-without-id-property! (:block/format block) md-content html sorted-blocks)
(delete-block-aux! block true))))

Expand Down
17 changes: 1 addition & 16 deletions src/main/frontend/state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,6 @@
;; graph -> state
:graph/parsing-state {}

;; copied blocks
:copy/blocks {:copy/content nil
:copy/graph nil
:copy/blocks nil}

:copy/export-block-text-indent-style (or (storage/get :copy/export-block-text-indent-style)
"dashes")
:copy/export-block-text-remove-options (or (storage/get :copy/export-block-text-remove-options)
Expand Down Expand Up @@ -753,7 +748,7 @@ Similar to re-frame subscriptions"
"Returns the current repo URL, or else open demo graph"
[]
(or (:git/current-repo @state)
"local"))
"local"))

(defn get-remote-graphs
[]
Expand Down Expand Up @@ -1711,16 +1706,6 @@ Similar to re-frame subscriptions"
(let [chan (get-events-chan)]
(async/put! chan payload)))

(defn get-copied-blocks
[]
(:copy/blocks @state))

(defn set-copied-blocks!
[content blocks]
(set-state! :copy/blocks {:copy/graph (get-current-repo)
:copy/content (or content (get-in @state [:copy/blocks :copy/content]))
:copy/blocks blocks}))

(defn get-export-block-text-indent-style []
(:copy/export-block-text-indent-style @state))

Expand Down

0 comments on commit 4351213

Please sign in to comment.