From 0fee8143dd918e869fcb7a293b46b04b270c8d3d Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 4 Feb 2025 16:46:09 +0100 Subject: [PATCH] :zap: Don't use seq operations for string includes operation --- frontend/src/app/main/ui/workspace/tokens/token_pill.cljs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/token_pill.cljs b/frontend/src/app/main/ui/workspace/tokens/token_pill.cljs index 209aaed62..fb356f58a 100644 --- a/frontend/src/app/main/ui/workspace/tokens/token_pill.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/token_pill.cljs @@ -144,11 +144,13 @@ {::mf/wrap-props false} [{:keys [on-click token theme-token full-applied on-context-menu half-applied selected-shapes token-type-props active-theme-tokens]}] (let [{:keys [name value errors]} token - is-reference (some #(= % "{") value) + + is-reference? (str/includes? value "{") + can-edit? (:can-edit (deref refs/permissions)) is-viewer (not can-edit?) - ref-not-in-active-set (and is-reference + ref-not-in-active-set (and is-reference? (not (contains-reference-value? value (keys active-theme-tokens)))) no-valid-value (seq errors) errors? (or ref-not-in-active-set