From e008766d2ba65e2431ae27a7c67f549e5b8e1e26 Mon Sep 17 00:00:00 2001 From: charlie Date: Wed, 6 Jul 2022 11:05:19 +0800 Subject: [PATCH] fix(ui): remove plugin ui items manager from pagebar --- src/main/frontend/components/plugins.cljs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/frontend/components/plugins.cljs b/src/main/frontend/components/plugins.cljs index b950221e9..437467afd 100644 --- a/src/main/frontend/components/plugins.cljs +++ b/src/main/frontend/components/plugins.cljs @@ -855,26 +855,31 @@ "type of :toolbar, :pagebar" [_state type] (when (state/sub [:plugin/installed-ui-items]) - (let [pinned-items (state/sub [:plugin/preferences :pinnedToolbarItems]) + (let [toolbar? (= :toolbar type) + pinned-items (state/sub [:plugin/preferences :pinnedToolbarItems]) pinned-items (and (sequential? pinned-items) (into #{} pinned-items)) items (state/get-plugins-ui-items-with-type type) items (sort-by #(:key (second %)) items)] (when-let [items (and (seq items) - (map #(assoc-in % [1 :pinned?] - (let [[_ {:keys [key]} pid] % - pkey (str (name pid) ":" key)] - (contains? pinned-items pkey))) - items))] + (if toolbar? + (map #(assoc-in % [1 :pinned?] + (let [[_ {:keys [key]} pid] % + pkey (str (name pid) ":" key)] + (contains? pinned-items pkey))) + items) + items))] [:div {:class (str "ui-items-container") :data-type (name type)} (conj (for [[_ {:keys [key pinned?] :as opts} pid] items] - (when (or (not (set? pinned-items)) pinned?) + (when (or (not toolbar?) + (not (set? pinned-items)) pinned?) (rum/with-key (ui-item-renderer pid type opts) key)))) ;; manage plugin buttons - (toolbar-plugins-manager-list items)])))) + (when toolbar? + (toolbar-plugins-manager-list items))])))) (rum/defcs hook-ui-fenced-code < rum/reactive [_state content {:keys [render edit] :as _opts}]