0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Fix add to recent colors when changing fill or opacity manually

This commit is contained in:
Alejandro Alonso 2022-09-21 12:21:58 +02:00
parent 3063725a62
commit 726baefa25

View file

@ -10,7 +10,9 @@
[app.common.data.macros :as dm]
[app.common.pages :as cp]
[app.main.data.modal :as modal]
[app.main.data.workspace.libraries :as dwl]
[app.main.refs :as refs]
[app.main.store :as st]
[app.main.ui.components.color-bullet :as cb]
[app.main.ui.components.color-input :refer [color-input]]
[app.main.ui.components.numeric-input :refer [numeric-input]]
@ -73,18 +75,22 @@
(mf/use-fn
(mf/deps color on-change)
(fn [new-value]
(on-change (-> color
(assoc :color new-value)
(dissoc :gradient)))))
(let [color (-> color
(assoc :color new-value)
(dissoc :gradient))]
(st/emit! (dwl/add-recent-color color)
(on-change color)))))
handle-opacity-change
(mf/use-fn
(mf/deps color on-change)
(fn [value]
(on-change (assoc color
:opacity (/ value 100)
:id nil
:file-id nil))))
(let [color (assoc color
:opacity (/ value 100)
:id nil
:file-id nil)]
(st/emit! (dwl/add-recent-color color)
(on-change color)))))
handle-click-color
(mf/use-fn