From 6c6be35292c4e292935e138438c1aad6601b89d0 Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Wed, 21 Aug 2024 15:12:13 +0200 Subject: [PATCH] Fix token updates not taking order --- .../src/app/main/ui/workspace/tokens/token_set.cljs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/token_set.cljs b/frontend/src/app/main/ui/workspace/tokens/token_set.cljs index f98029f086..6a6a737c83 100644 --- a/frontend/src/app/main/ui/workspace/tokens/token_set.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/token_set.cljs @@ -15,6 +15,9 @@ (defn get-workspace-themes-index [state] (get-in state [:workspace-data :token-themes-index] {})) +(defn get-workspace-token-set-groups [state] + (get-in state [:workspace-data :token-set-groups])) + (defn get-workspace-ordered-themes [state] (let [themes (get-workspace-themes state) themes-index (get-workspace-themes-index state)] @@ -45,6 +48,11 @@ #{} active-theme-ids)] active-set-ids)) +(defn get-ordered-active-set-ids [state] + (let [active-set-ids (get-active-set-ids state) + token-set-groups (get-workspace-token-set-groups state)] + (filter active-set-ids token-set-groups))) + (defn theme-ids-with-group "Returns set of theme-ids that share the same `:group` property as the theme with `theme-id`. Will also return matching theme-ids without a `:group` property." @@ -129,7 +137,7 @@ (assoc-in state [:workspace-local :selected-token-set-id] id)) (defn get-active-theme-sets-tokens-names-map [state] - (let [active-set-ids (get-active-set-ids state)] + (let [active-set-ids (get-ordered-active-set-ids state)] (reduce (fn [names-map-acc set-id] (let [token-ids (get-workspace-token-set-tokens set-id state)]