0
Fork 0
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:
Alejandro Alonso 2024-06-26 12:57:53 +02:00
parent 8a63089773
commit 9ca1535a65

View file

@ -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