0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-16 00:41:25 -05:00

Merge pull request #4778 from penpot/superalex-fix-crash-when-new-colorpicker-while-image-upload

🐛 Penpot crashes when a new colorpicker is created while uploadin…
This commit is contained in:
Andrey Antukh 2024-06-20 10:36:44 +02:00 committed by GitHub
commit e5cc262644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -47,6 +47,7 @@
- Fix SVG attrs are not handled correctly when exporting/importing in .zip [Taiga #7920](https://tree.taiga.io/project/penpot/issue/7920)
- Fix validation error when detaching with two nested copies and a swap [Taiga #8095](https://tree.taiga.io/project/penpot/issue/8095)
- Export shapes that are rotated act a bit strange when reimported [Taiga #7585](https://tree.taiga.io/project/penpot/issue/7585)
- Penpot crashes when a new colorpicker is created while uploading an image to another instance [Taiga #8119](https://tree.taiga.io/project/penpot/issue/8119)
## 2.0.3

View file

@ -590,7 +590,7 @@
(update [_ state]
(update state :colorpicker
(fn [state]
(let [type (:type state)
(let [type (:type state)
state (-> state
(update :current-color merge changes)
(update :current-color materialize-color-components)
@ -605,11 +605,12 @@
(-> state
(dissoc :gradient :stops :editing-stop)
(cond-> (not= :image (:type state))
(cond-> (not= :image type)
(assoc :type :color))))))))
ptk/WatchEvent
(watch [_ state _]
(when add-recent?
;; 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))]
(rx/of (dwl/add-recent-color formated-color)))))))