From 750e8a9d513b3a668bad3f1f4c09a13906f40f93 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 24 Mar 2026 15:35:32 +0100 Subject: [PATCH] :bug: Fix dissoc error when detaching stroke color from library (#8738) * :bug: 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 * :bug: 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 --------- Signed-off-by: Andrey Antukh --- .../app/main/ui/workspace/sidebar/options/rows/color_row.cljs | 4 ++-- .../main/ui/workspace/sidebar/options/rows/stroke_row.cljs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs index 7e6e47241a..71e6ec2eb9 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs @@ -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 diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/rows/stroke_row.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/rows/stroke_row.cljs index ec5770eabb..7cb0956d11 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/rows/stroke_row.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/rows/stroke_row.cljs @@ -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