From c6b1263d3366eee54821a486df50e97cfa2503cd Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 22 Nov 2016 18:04:08 +0100 Subject: [PATCH] Assign proper type to fetched image collections. --- frontend/src/uxbox/main/data/images.cljs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/uxbox/main/data/images.cljs b/frontend/src/uxbox/main/data/images.cljs index eaa0a14ca..b37e36bd9 100644 --- a/frontend/src/uxbox/main/data/images.cljs +++ b/frontend/src/uxbox/main/data/images.cljs @@ -59,9 +59,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 [:images-collections id] item))) state items)))