0
Fork 0
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:
Andrey Antukh 2016-11-21 18:56:04 +01:00
parent c018a39f7b
commit b0a4cdcc17
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
2 changed files with 10 additions and 3 deletions

View file

@ -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)))

View file

@ -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."
[]