mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
Replace sidebar block instead of redirecting when clicking breadcrumb
This commit is contained in:
@@ -769,6 +769,13 @@
|
||||
(when (empty? (:sidebar/blocks @state))
|
||||
(hide-right-sidebar!)))
|
||||
|
||||
(defn sidebar-replace-block!
|
||||
[old-sidebar-key new-sidebar-key]
|
||||
(update-state! :sidebar/blocks (fn [blocks]
|
||||
(map #(if (= % old-sidebar-key)
|
||||
new-sidebar-key
|
||||
%) blocks))))
|
||||
|
||||
(defn sidebar-block-exists?
|
||||
[idx]
|
||||
(some #(= (second %) idx) (:sidebar/blocks @state)))
|
||||
|
||||
Reference in New Issue
Block a user