feat: cmd+c cmd+c to clear the right sidebar

pull/2701/head
Tienson Qin 2021-08-23 23:45:12 +08:00
parent c2e7593923
commit 64ff907974
2 changed files with 11 additions and 1 deletions

View File

@ -306,7 +306,13 @@
:binding "mod+c mod+r"
:fn #(repo-handler/re-index!
nfs-handler/rebuild-index!
page-handler/create-today-journal!)}}
page-handler/create-today-journal!)}
:sidebar/clear
{:desc "Clear all in the right sidebar"
:binding "mod+c mod+c"
:fn #(do
(state/clear-sidebar-blocks!)
(state/hide-right-sidebar!))}}
:shortcut.handler/misc
;; always overrides the copy due to "mod+c mod+s"

View File

@ -741,6 +741,10 @@
[]
(:sidebar/blocks @state))
(defn clear-sidebar-blocks!
[]
(set-state! :sidebar/blocks '()))
(defn sidebar-block-toggle-collapse!
[db-id]
(when db-id