From 99e8b226728a4b3a348adab23fb30f04407da3a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 31 Oct 2025 14:22:50 +0100 Subject: [PATCH] :bug: Fix theme validation when still no tokens library exists --- .../app/main/ui/workspace/tokens/themes/create_modal.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs b/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs index 576c6044c1..7eb31aa15b 100644 --- a/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/themes/create_modal.cljs @@ -44,9 +44,11 @@ (m/-simple-schema {:type :token/name-exists :pred (fn [name] - (let [theme (ctob/get-theme-by-name tokens-lib group name)] - (or (nil? theme) - (= (ctob/get-id theme) theme-id)))) + (if tokens-lib + (let [theme (ctob/get-theme-by-name tokens-lib group name)] + (or (nil? theme) + (= (ctob/get-id theme) theme-id))) + true)) ;; if still no library exists, cannot be duplicate :type-properties {:error/fn #(tr "workspace.tokens.theme-name-already-exists")}})) (defn- validate-theme-name