mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
Merge pull request #4805 from penpot/superalex-fix-selected-colors-do-not-appear-in-color-palette
🐛 Selected colors do not appear in the color palette
This commit is contained in:
commit
16a0e1f578
@ -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…
x
Reference in New Issue
Block a user