From 4adb79e869ca43a10fb61f7b0acd5fa0d13cb805 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Tue, 27 Oct 2020 13:03:19 +0100 Subject: [PATCH] :bug: Fixes problem with colorpicker libraries --- frontend/src/app/main/ui/workspace/colorpicker.cljs | 7 ++++--- .../src/app/main/ui/workspace/colorpicker/libraries.cljs | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index abcdae7a8..c0ff40544 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -167,11 +167,12 @@ on-select-library-color (fn [color] - (reset! dirty? true) - (reset! state (data->state color))) + (reset! state (data->state color)) + (on-change color)) on-add-library-color - (fn [color] (st/emit! (dwl/add-color (state->data @state)))) + (fn [color] + (st/emit! (dwl/add-color (state->data @state)))) on-activate-gradient (fn [type] diff --git a/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs b/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs index a28100789..2912a88fe 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/libraries.cljs @@ -66,8 +66,10 @@ (vals file-colors) :else ;; Library UUID - (map #(merge {:file-id (uuid @selected-library)}) - (vals (get-in shared-libs [(uuid @selected-library) :data :colors]))))] + (->> (get-in shared-libs [(uuid @selected-library) :data :colors]) + (vals) + (map #(merge % {:file-id (uuid @selected-library)}))))] + (reset! current-library-colors (into [] (filter check-valid-color?) mapped-colors))))) ;; If the file colors change and the file option is selected updates the state