diff --git a/frontend/src/uxbox/main/data/icons.cljs b/frontend/src/uxbox/main/data/icons.cljs index 6e14d44d88..1a580c026b 100644 --- a/frontend/src/uxbox/main/data/icons.cljs +++ b/frontend/src/uxbox/main/data/icons.cljs @@ -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))) diff --git a/frontend/src/uxbox/util/uuid.cljs b/frontend/src/uxbox/util/uuid.cljs index db225b57e5..11b11a8b54 100644 --- a/frontend/src/uxbox/util/uuid.cljs +++ b/frontend/src/uxbox/util/uuid.cljs @@ -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." []