From 432a139f35ef19baea1eeef9af85cb56304c23fd Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 17 Sep 2020 12:47:19 +0200 Subject: [PATCH] :bug: Fixes problem with picker data --- frontend/src/app/main/data/colors.cljs | 2 +- .../src/app/main/ui/workspace/colorpicker.cljs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/main/data/colors.cljs b/frontend/src/app/main/data/colors.cljs index 2854c0907..ac1d1513e 100644 --- a/frontend/src/app/main/data/colors.cljs +++ b/frontend/src/app/main/data/colors.cljs @@ -219,7 +219,7 @@ (defn picker-for-selected-shape [] ;; TODO: replace st/emit! by a subject push and set that in the WatchEvent - (let [handle-change-color (fn [color _ shift?] + (let [handle-change-color (fn [color opacity id file-id shift?] (let [ids (get-in @st/state [:workspace-local :selected])] (st/emit! (if shift? diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index c3ed2b7a2..2607b6599 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -195,12 +195,12 @@ :h h :s s :v v :hex hex) (when picked-color-select - (on-change hex (:alpha @current-color) picked-shift?)))))) + (on-change hex (:alpha @current-color) nil nil picked-shift?)))))) (mf/use-effect (mf/deps picking-color? picked-color-select) (fn [] (when (and picking-color? picked-color-select) - (on-change (:hex @current-color) (:alpha @current-color) picked-shift?)))) + (on-change (:hex @current-color) (:alpha @current-color) nil nil picked-shift?)))) [:div.colorpicker {:ref ref-picker} [:div.top-actions @@ -397,18 +397,18 @@ position (or position :left) style (calculate-position vport position x y) - handle-change (fn [new-value new-opacity op1 op2] + handle-change (fn [new-value new-opacity id file-id shift-clicked?] (when (or (not= new-value value) (not= new-opacity opacity)) (reset! dirty? true)) - (reset! last-change [new-value new-opacity op1 op2]) + (reset! last-change [new-value new-opacity id file-id]) (when on-change - (on-change new-value new-opacity op1 op2)))] + (on-change new-value new-opacity id file-id shift-clicked?)))] (mf/use-effect (fn [] #(when (and @dirty? on-close) - (when-let [[value opacity op1 op2] @last-change] - (on-close value opacity op1 op2))))) + (when-let [[value opacity id file-id] @last-change] + (on-close value opacity id file-id))))) [:div.colorpicker-tooltip {:style (clj->js style)}