mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 17:36:12 +02:00
⚡ Don't use seq operations for string includes operation
This commit is contained in:
parent
b6e26d15e1
commit
0fee8143dd
1 changed files with 4 additions and 2 deletions
|
@ -144,11 +144,13 @@
|
||||||
{::mf/wrap-props false}
|
{::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]}]
|
[{: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
|
(let [{:keys [name value errors]} token
|
||||||
is-reference (some #(= % "{") value)
|
|
||||||
|
is-reference? (str/includes? value "{")
|
||||||
|
|
||||||
can-edit? (:can-edit (deref refs/permissions))
|
can-edit? (:can-edit (deref refs/permissions))
|
||||||
|
|
||||||
is-viewer (not can-edit?)
|
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))))
|
(not (contains-reference-value? value (keys active-theme-tokens))))
|
||||||
no-valid-value (seq errors)
|
no-valid-value (seq errors)
|
||||||
errors? (or ref-not-in-active-set
|
errors? (or ref-not-in-active-set
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue