mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix dissoc error when detaching stroke color from library (#8738)
* 🐛 Fix dissoc error when detaching stroke color from library The detach-value function in color-row was only passing index to on-detach, but the stroke's on-color-detach handler expects both index and color arguments. This caused a protocol error when trying to dissoc from a number instead of a map. Signed-off-by: Andrey Antukh <niwi@niwi.nz> * 🐛 Fix crash when detaching color asset from stroke The color_row detach-value callback calls on-detach with (index, color), but stroke_row's local on-color-detach wrapper only took a single argument (fn [color] ...), so it received index as color and passed it to stroke.cljs which then called (dissoc index :ref-id :ref-file), crashing with 'No protocol method IMap.-dissoc defined for type number'. Fix the wrapper to accept (fn [_ color] ...) so it correctly ignores the index passed by color_row (it already has index in the closure) and forwards the actual color map to the parent handler. Signed-off-by: Andrey Antukh <niwi@niwi.nz> --------- Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
f88e287357
commit
750e8a9d51
@ -205,10 +205,10 @@
|
||||
|
||||
detach-value
|
||||
(mf/use-fn
|
||||
(mf/deps on-detach index)
|
||||
(mf/deps on-detach index color)
|
||||
(fn [_]
|
||||
(when on-detach
|
||||
(on-detach index))))
|
||||
(on-detach index color))))
|
||||
|
||||
handle-select
|
||||
(mf/use-fn
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
on-color-detach
|
||||
(mf/use-fn
|
||||
(mf/deps index on-color-detach)
|
||||
(fn [color]
|
||||
(fn [_ color]
|
||||
(on-color-detach index color)))
|
||||
|
||||
on-remove
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user