mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
🐛 Fix add asset color, invalid color appears
This commit is contained in:
parent
c988d54925
commit
a8e058ada6
2 changed files with 8 additions and 4 deletions
|
@ -21,7 +21,6 @@
|
|||
[app.main.data.workspace.state-helpers :as wsh]
|
||||
[app.main.data.workspace.texts :as dwt]
|
||||
[app.main.data.workspace.undo :as dwu]
|
||||
[app.main.store :as st]
|
||||
[app.util.color :as uc]
|
||||
[beicon.core :as rx]
|
||||
[potok.core :as ptk]))
|
||||
|
@ -610,7 +609,7 @@
|
|||
(materialize-color-components))]))))))))))
|
||||
|
||||
(defn select-color
|
||||
[position]
|
||||
[position add-color]
|
||||
(ptk/reify ::select-color
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
|
@ -635,7 +634,7 @@
|
|||
(rx/of (md/show :colorpicker
|
||||
{:x (:x position)
|
||||
:y (:y position)
|
||||
:on-accept #(st/emit! (dwl/add-color data))
|
||||
:on-accept add-color
|
||||
:data data
|
||||
:position :right})
|
||||
(ptk/event ::ev/event {::ev/name "add-asset-to-library"
|
||||
|
|
|
@ -1546,11 +1546,16 @@
|
|||
|
||||
read-only? (mf/use-ctx ctx/workspace-read-only?)
|
||||
|
||||
add-color
|
||||
(mf/use-fn
|
||||
(fn [value _]
|
||||
(st/emit! (dwl/add-color value))))
|
||||
|
||||
add-color-clicked
|
||||
(mf/use-fn
|
||||
(fn [event]
|
||||
(let [position (dom/get-client-position event)]
|
||||
(st/emit! (dc/select-color position)))))
|
||||
(st/emit! (dc/select-color position add-color)))))
|
||||
|
||||
create-group
|
||||
(mf/use-fn
|
||||
|
|
Loading…
Add table
Reference in a new issue