From e38d78a7b4c32305965f83812ec6198ce4255156 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 29 Jan 2021 12:24:04 +0100 Subject: [PATCH] :bug: Fixes problem in handoff --- frontend/src/app/main/ui/handoff/right_sidebar.cljs | 6 +++--- frontend/src/app/main/ui/handoff/selection_feedback.cljs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/handoff/right_sidebar.cljs b/frontend/src/app/main/ui/handoff/right_sidebar.cljs index ce9abf05c..cce8f4f10 100644 --- a/frontend/src/app/main/ui/handoff/right_sidebar.cljs +++ b/frontend/src/app/main/ui/handoff/right_sidebar.cljs @@ -29,14 +29,14 @@ (mapv resolve-shape selected)))] #(l/derived selected->shapes st/state))) - (mf/defc right-sidebar [{:keys [frame page-id file-id]}] (let [expanded (mf/use-state false) locale (mf/deref i18n/locale) section (mf/use-state :info #_:code) selected-ref (mf/use-memo (make-selected-shapes-iref)) - shapes (mf/deref selected-ref)] + shapes (mf/deref selected-ref) + selected-type (-> shapes first (:type :not-found))] [:aside.settings-bar.settings-bar-right {:class (when @expanded "expanded")} [:div.settings-bar-inside (when (seq shapes) @@ -49,7 +49,7 @@ [:* [:span.tool-window-bar-icon [:& element-icon {:shape (-> shapes first)}]] - [:span.tool-window-bar-title (->> shapes first :type name (str "handoff.tabs.code.selected.") (t locale))]]) + [:span.tool-window-bar-title (->> selected-type name (str "handoff.tabs.code.selected.") (t locale))]]) ] [:div.tool-window-content [:& tab-container {:on-change-tab #(do diff --git a/frontend/src/app/main/ui/handoff/selection_feedback.cljs b/frontend/src/app/main/ui/handoff/selection_feedback.cljs index 371134d56..a382b26a4 100644 --- a/frontend/src/app/main/ui/handoff/selection_feedback.cljs +++ b/frontend/src/app/main/ui/handoff/selection_feedback.cljs @@ -40,7 +40,7 @@ (let [selected (get-in state [:viewer-local :selected]) objects (get-in state [:viewer-data :page :objects]) resolve-shape #(get objects %)] - (mapv resolve-shape selected)))] + (->> selected (map resolve-shape) (filterv (comp not nil?)))))] #(l/derived selected->shapes st/state))) (defn make-hover-shapes-iref