mirror of https://github.com/logseq/logseq
fix: toggle help
parent
759667e041
commit
21b2c5296a
|
@ -292,7 +292,7 @@
|
|||
;; ?
|
||||
191 (fn [state e]
|
||||
(when-not (util/input? (gobj/get e "target"))
|
||||
(state/sidebar-add-block! (state/get-current-repo) "help" :help nil)))})))
|
||||
(ui-handler/toggle-help!)))})))
|
||||
{:did-mount (fn [state]
|
||||
(keyboards/bind-shortcuts!)
|
||||
state)}
|
||||
|
|
|
@ -33,6 +33,14 @@
|
|||
(state/sidebar-remove-block! id)
|
||||
(state/sidebar-add-block! current-repo id :contents nil)))))
|
||||
|
||||
(defn toggle-help!
|
||||
[]
|
||||
(when-let [current-repo (state/get-current-repo)]
|
||||
(let [id "help"]
|
||||
(if (state/sidebar-block-exists? id)
|
||||
(state/sidebar-remove-block! id)
|
||||
(state/sidebar-add-block! current-repo id :help nil)))))
|
||||
|
||||
(defn toggle-settings-modal!
|
||||
[]
|
||||
(state/toggle-settings!))
|
||||
|
|
|
@ -652,8 +652,8 @@
|
|||
(defn sidebar-remove-block!
|
||||
[idx]
|
||||
(update-state! :sidebar/blocks (fn [blocks]
|
||||
(if (= (str idx) "contents")
|
||||
(remove #(= (second %) "contents") blocks)
|
||||
(if (string? idx)
|
||||
(remove #(= (second %) idx) blocks)
|
||||
(util/drop-nth idx blocks))))
|
||||
(when (empty? (:sidebar/blocks @state))
|
||||
(hide-right-sidebar!)))
|
||||
|
|
Loading…
Reference in New Issue