mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
♻️ Do a small performance refactor
This commit is contained in:
parent
a4bbfe3c79
commit
1af4325e8f
1 changed files with 8 additions and 8 deletions
|
@ -347,14 +347,14 @@
|
||||||
in the map nor in the objects tree."
|
in the map nor in the objects tree."
|
||||||
[interactions ids-map objects]
|
[interactions ids-map objects]
|
||||||
(when (some? interactions)
|
(when (some? interactions)
|
||||||
(->> interactions
|
(let [xform (comp (filter (fn [interaction]
|
||||||
(filterv (fn [interaction]
|
(let [destination (:destination interaction)]
|
||||||
(let [destination (:destination interaction)]
|
(or (nil? destination)
|
||||||
(or (nil? destination)
|
(contains? ids-map destination)
|
||||||
(contains? ids-map destination)
|
(contains? objects destination)))))
|
||||||
(contains? objects destination)))))
|
(map (fn [interaction]
|
||||||
(mapv (fn [interaction]
|
(d/update-when interaction :destination #(get ids-map % %)))))]
|
||||||
(d/update-when interaction :destination #(get ids-map % %)))))))
|
(into [] xform interactions))))
|
||||||
|
|
||||||
(defn actionable?
|
(defn actionable?
|
||||||
"Check if there is any interaction that is clickable by the user"
|
"Check if there is any interaction that is clickable by the user"
|
||||||
|
|
Loading…
Reference in a new issue