mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 21:09:00 -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]
|
(defrecord CollectionsFetched [items]
|
||||||
rs/UpdateEvent
|
rs/UpdateEvent
|
||||||
(-apply-update [_ state]
|
(-apply-update [_ state]
|
||||||
(reduce (fn [state item]
|
(reduce (fn [state {:keys [id user] :as item}]
|
||||||
(let [id (:id item)
|
(let [type (if (uuid/zero? (:user item)) :builtin :own)
|
||||||
item (assoc item :type :own)]
|
item (assoc item :type type)]
|
||||||
(assoc-in state [:icons-collections id] item)))
|
(assoc-in state [:icons-collections id] item)))
|
||||||
state
|
state
|
||||||
items)))
|
items)))
|
||||||
|
|
|
@ -13,8 +13,15 @@
|
||||||
|
|
||||||
If no high qualiry RNG, switches to the default Math based
|
If no high qualiry RNG, switches to the default Math based
|
||||||
RNG with proper waring in the console."
|
RNG with proper waring in the console."
|
||||||
|
(:refer-clojure :exclude [zero?])
|
||||||
(:require [uxbox.util.uuid-impl :as impl]))
|
(:require [uxbox.util.uuid-impl :as impl]))
|
||||||
|
|
||||||
|
(def zero #uuid "00000000-0000-0000-0000-000000000000")
|
||||||
|
|
||||||
|
(defn zero?
|
||||||
|
[v]
|
||||||
|
(= zero v))
|
||||||
|
|
||||||
(defn v4
|
(defn v4
|
||||||
"Generate a v4 (random) UUID."
|
"Generate a v4 (random) UUID."
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Add table
Reference in a new issue