mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Selected colors do not appear in the color palette
This commit is contained in:
parent
8a63089773
commit
9ca1535a65
1 changed files with 7 additions and 3 deletions
|
@ -609,9 +609,13 @@
|
|||
(assoc :type :color))))))))
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
;; Type can be null, because the colorpicker can be closed while a color image finish its upload
|
||||
(when (and add-recent? (some? (:type state)))
|
||||
(let [formated-color (get-color-from-colorpicker-state (:colorpicker state))]
|
||||
(let [selected-type (-> state
|
||||
:colorpicker
|
||||
:type)
|
||||
formated-color (get-color-from-colorpicker-state (:colorpicker state))
|
||||
;; Type is set to color on closing the colorpicker, but we can can close it while still uploading an image fill
|
||||
ignore-color? (and (= selected-type :color) (nil? (:color formated-color)))]
|
||||
(when (and add-recent? (not ignore-color?))
|
||||
(rx/of (dwl/add-recent-color formated-color)))))))
|
||||
|
||||
(defn update-colorpicker-gradient
|
||||
|
|
Loading…
Add table
Reference in a new issue