From 8dd6c8457f519d908bc363850e967ef6916ff261 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 21 Jan 2020 13:15:13 +0100 Subject: [PATCH] :sparkles: Use uuid1 instead of uuid4 on all the codebase. --- frontend/src/uxbox/main/data/colors.cljs | 2 +- frontend/src/uxbox/main/data/icons.cljs | 2 +- frontend/src/uxbox/main/data/images.cljs | 2 +- frontend/src/uxbox/main/data/workspace.cljs | 8 ++++---- frontend/src/uxbox/main/store.cljs | 2 +- frontend/src/uxbox/main/ui/workspace/drawarea.cljs | 2 +- frontend/src/uxbox/util/workers.cljs | 4 ++-- frontend/src/uxbox/worker.cljs | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/src/uxbox/main/data/colors.cljs b/frontend/src/uxbox/main/data/colors.cljs index 871492be5..1ebaa3ce9 100644 --- a/frontend/src/uxbox/main/data/colors.cljs +++ b/frontend/src/uxbox/main/data/colors.cljs @@ -79,7 +79,7 @@ (defn create-collection [] - (let [id (uuid/random)] + (let [id (uuid/next)] (CreateCollection. id))) ;; --- Persist Collections diff --git a/frontend/src/uxbox/main/data/icons.cljs b/frontend/src/uxbox/main/data/icons.cljs index 202e3a9cb..19010548c 100644 --- a/frontend/src/uxbox/main/data/icons.cljs +++ b/frontend/src/uxbox/main/data/icons.cljs @@ -201,7 +201,7 @@ (prepare [[content metadata]] {:collection-id id :content content - :id (uuid/random) + :id (uuid/next) ;; TODO Keep the name of the original icon :name (str "Icon " (gensym "i")) :metadata metadata})] diff --git a/frontend/src/uxbox/main/data/images.cljs b/frontend/src/uxbox/main/data/images.cljs index b635987d4..4ce8013f5 100644 --- a/frontend/src/uxbox/main/data/images.cljs +++ b/frontend/src/uxbox/main/data/images.cljs @@ -193,7 +193,7 @@ (prepare [[file [width height]]] (cond-> {:name (.-name file) :mimetype (.-type file) - :id (uuid/random) + :id (uuid/next) :file file :width width :height height} diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 9db19691a..ad7514235 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -425,7 +425,7 @@ ptk/UpdateEvent (update [_ state] (let [selected (get-in state [:workspace :selected]) - item {:id (uuid/random) + item {:id (uuid/next) :created-at (dt/now) :items selected} clipboard (-> (:clipboard state) @@ -547,7 +547,7 @@ (defn add-shape [data] (us/assert ::shape-attrs data) - (let [id (uuid/random)] + (let [id (uuid/next)] (ptk/reify ::add-shape ptk/UpdateEvent (update [_ state] @@ -576,7 +576,7 @@ (defn add-canvas [data] (us/assert ::shape-attrs data) - (let [id (uuid/random)] + (let [id (uuid/next)] (ptk/reify ::add-canvas ptk/UpdateEvent (update [_ state] @@ -600,7 +600,7 @@ (defn impl-duplicate-shape [state id] (let [shape (get-in state [:workspace-data :shapes-by-id id])] - (assoc shape :id (uuid/random)))) + (assoc shape :id (uuid/next)))) (def duplicate-selected (ptk/reify ::duplicate-selected diff --git a/frontend/src/uxbox/main/store.cljs b/frontend/src/uxbox/main/store.cljs index 6d8db3ca5..3154a4b0a 100644 --- a/frontend/src/uxbox/main/store.cljs +++ b/frontend/src/uxbox/main/store.cljs @@ -56,7 +56,7 @@ (def initial-state {:route nil :router nil - :session-id (uuid/random) + :session-id (uuid/next) :auth (:auth storage) :profile (:profile storage) :clipboard #queue [] diff --git a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs index 8e46ec1f2..51e473400 100644 --- a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs @@ -88,7 +88,7 @@ [type] (let [tool (seek #(= type (:type %)) minimal-shapes)] (assert tool "unexpected drawing tool") - (assoc tool :id (uuid/random)))) + (assoc tool :id (uuid/next)))) (defn handle-drawing [type] diff --git a/frontend/src/uxbox/util/workers.cljs b/frontend/src/uxbox/util/workers.cljs index 823d0711e..3cebb94d8 100644 --- a/frontend/src/uxbox/util/workers.cljs +++ b/frontend/src/uxbox/util/workers.cljs @@ -19,7 +19,7 @@ (deftype WebWorker [stream wrk] IWorker (-ask [this message] - (let [sender (uuid/random) + (let [sender (uuid/next) data (assoc message :sender sender) data (t/encode data)] (.postMessage wrk data) @@ -28,7 +28,7 @@ (rx/take 1)))) (-send [this message] - (let [sender (uuid/random) + (let [sender (uuid/next) data (assoc message :sender sender) data (t/encode data)] (.postMessage wrk data) diff --git a/frontend/src/uxbox/worker.cljs b/frontend/src/uxbox/worker.cljs index 72a965cc8..ed944f19e 100644 --- a/frontend/src/uxbox/worker.cljs +++ b/frontend/src/uxbox/worker.cljs @@ -14,7 +14,7 @@ (enable-console-print!) -(defonce id (uuid/random)) +(defonce id (uuid/next)) (defn- on-message [event]