mirror of
https://github.com/penpot/penpot.git
synced 2025-01-25 07:58:49 -05:00
Mark as :builtin icon collections that has :user as uuid/zero.
This commit is contained in:
parent
c018a39f7b
commit
b0a4cdcc17
2 changed files with 10 additions and 3 deletions
|
@ -60,9 +60,9 @@
|
|||
(defrecord CollectionsFetched [items]
|
||||
rs/UpdateEvent
|
||||
(-apply-update [_ state]
|
||||
(reduce (fn [state item]
|
||||
(let [id (:id item)
|
||||
item (assoc item :type :own)]
|
||||
(reduce (fn [state {:keys [id user] :as item}]
|
||||
(let [type (if (uuid/zero? (:user item)) :builtin :own)
|
||||
item (assoc item :type type)]
|
||||
(assoc-in state [:icons-collections id] item)))
|
||||
state
|
||||
items)))
|
||||
|
|
|
@ -13,8 +13,15 @@
|
|||
|
||||
If no high qualiry RNG, switches to the default Math based
|
||||
RNG with proper waring in the console."
|
||||
(:refer-clojure :exclude [zero?])
|
||||
(:require [uxbox.util.uuid-impl :as impl]))
|
||||
|
||||
(def zero #uuid "00000000-0000-0000-0000-000000000000")
|
||||
|
||||
(defn zero?
|
||||
[v]
|
||||
(= zero v))
|
||||
|
||||
(defn v4
|
||||
"Generate a v4 (random) UUID."
|
||||
[]
|
||||
|
|
Loading…
Add table
Reference in a new issue