From e6b5b1e372d49bb28e7fd6ba8bfbbef81b7ef07b Mon Sep 17 00:00:00 2001 From: charlie Date: Sat, 31 Jan 2026 14:34:59 +0800 Subject: [PATCH] fix(ui): right sidebar toggle functionality --- src/main/frontend/state.cljs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index ab560ddeba..c72cca8df4 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -1115,11 +1115,6 @@ Similar to re-frame subscriptions" (when (empty? (:sidebar/blocks @state)) (sidebar-add-block! (get-current-repo) "contents" :contents))) -(defn toggle-sidebar-open?! - [] - (when-not (:ui/sidebar-open? @state) - (sidebar-add-content-when-open!)) - (swap! state update :ui/sidebar-open? not)) (defn open-right-sidebar! [] @@ -1130,6 +1125,12 @@ Similar to re-frame subscriptions" [] (swap! state assoc :ui/sidebar-open? false)) +(defn toggle-sidebar-open?! + [] + (if (:ui/sidebar-open? @state) + (hide-right-sidebar!) + (open-right-sidebar!))) + (defn sidebar-move-block! [from to] (update-state! :sidebar/blocks (fn [blocks]