From e240f14a373a8611dc211956f942c957de676463 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 14 Apr 2020 17:31:33 +0200 Subject: [PATCH] :bug: Add a workaround for duplicate ids. --- frontend/src/uxbox/main/ui/dashboard/library.cljs | 3 --- frontend/src/uxbox/main/ui/shapes/frame.cljs | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/frontend/src/uxbox/main/ui/dashboard/library.cljs b/frontend/src/uxbox/main/ui/dashboard/library.cljs index 5f7c378414..a8b3d7e2d0 100644 --- a/frontend/src/uxbox/main/ui/dashboard/library.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/library.cljs @@ -315,8 +315,6 @@ (-> (l/in [:library :last-deleted-library]) (l/derived st/state =))) -(defonce counter (atom 0)) - (mf/defc library-page [{:keys [team-id library-id section]}] (let [state (mf/use-state {:selected #{}}) @@ -333,7 +331,6 @@ last-deleted-library (mf/deref last-deleted-library-ref) selected-library (first (filter #(= (:id %) library-id) libraries)) - ] (mf/use-effect diff --git a/frontend/src/uxbox/main/ui/shapes/frame.cljs b/frontend/src/uxbox/main/ui/shapes/frame.cljs index 7fd9362691..fd0587d90b 100644 --- a/frontend/src/uxbox/main/ui/shapes/frame.cljs +++ b/frontend/src/uxbox/main/ui/shapes/frame.cljs @@ -11,6 +11,7 @@ (:require [lentes.core :as l] [rumext.alpha :as mf] + [uxbox.common.data :as d] [uxbox.main.constants :as c] [uxbox.main.data.workspace :as dw] [uxbox.main.geom :as geom] @@ -128,11 +129,10 @@ :id (str "shape-" id) :width width :height height}))] - [:svg {:x x :y y :width width :height height} [:> "rect" props] - (for [item childs] + (for [[i item] (d/enumerate childs)] [:& shape-wrapper {:frame shape :shape item - :key (:id item)}])]))) + :key (str i (:id item))}])])))