Simplify sidebar data

This commit is contained in:
Tienson Qin
2022-05-07 08:03:35 +08:00
parent 02296835d2
commit 4fc479495e
15 changed files with 81 additions and 111 deletions

View File

@@ -749,12 +749,12 @@
(swap! state assoc :ui/sidebar-open? false))
(defn sidebar-add-block!
[repo db-id block-type block-data]
[repo db-id block-type]
(when (not (util/sm-breakpoint?))
(when db-id
(update-state! :sidebar/blocks (fn [blocks]
(->> (remove #(= (second %) db-id) blocks)
(cons [repo db-id block-type block-data])
(cons [repo db-id block-type])
(distinct))))
(open-right-sidebar!)
(when-let [elem (gdom/getElementByClass "cp__right-sidebar-scrollable")]