From 9115e1a3a38c9733340362ae13ea999b593a2953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Tue, 25 Mar 2025 14:43:16 +0100 Subject: [PATCH] :bug: Fix resolved value when opening the token edit form --- frontend/src/app/main/ui/workspace/tokens/form.cljs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/form.cljs b/frontend/src/app/main/ui/workspace/tokens/form.cljs index 5a78178afd..9306904317 100644 --- a/frontend/src/app/main/ui/workspace/tokens/form.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/form.cljs @@ -235,7 +235,14 @@ token-properties (wtch/get-token-properties token) color? (wtt/color-token? token) selected-set-tokens (mf/deref refs/workspace-selected-token-set-tokens) - active-theme-tokens (mf/deref refs/workspace-active-theme-sets-tokens) + + active-theme-tokens (cond-> (mf/deref refs/workspace-active-theme-sets-tokens) + ;; Ensure that the resolved value uses the currently editing token + ;; even if the name has been overriden by a token with the same name + ;; in another set below. + (and (:name token) (:value token)) + (assoc (:name token) token)) + resolved-tokens (sd/use-resolved-tokens active-theme-tokens {:cache-atom form-token-cache-atom :interactive? true}) token-path (mf/use-memo