0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-27 00:49:28 -05:00

Use uuid1 instead of uuid4 on all the codebase.

This commit is contained in:
Andrey Antukh 2020-01-21 13:15:13 +01:00
parent 20cd5b1d9c
commit 8dd6c8457f
8 changed files with 12 additions and 12 deletions

View file

@ -79,7 +79,7 @@
(defn create-collection (defn create-collection
[] []
(let [id (uuid/random)] (let [id (uuid/next)]
(CreateCollection. id))) (CreateCollection. id)))
;; --- Persist Collections ;; --- Persist Collections

View file

@ -201,7 +201,7 @@
(prepare [[content metadata]] (prepare [[content metadata]]
{:collection-id id {:collection-id id
:content content :content content
:id (uuid/random) :id (uuid/next)
;; TODO Keep the name of the original icon ;; TODO Keep the name of the original icon
:name (str "Icon " (gensym "i")) :name (str "Icon " (gensym "i"))
:metadata metadata})] :metadata metadata})]

View file

@ -193,7 +193,7 @@
(prepare [[file [width height]]] (prepare [[file [width height]]]
(cond-> {:name (.-name file) (cond-> {:name (.-name file)
:mimetype (.-type file) :mimetype (.-type file)
:id (uuid/random) :id (uuid/next)
:file file :file file
:width width :width width
:height height} :height height}

View file

@ -425,7 +425,7 @@
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(let [selected (get-in state [:workspace :selected]) (let [selected (get-in state [:workspace :selected])
item {:id (uuid/random) item {:id (uuid/next)
:created-at (dt/now) :created-at (dt/now)
:items selected} :items selected}
clipboard (-> (:clipboard state) clipboard (-> (:clipboard state)
@ -547,7 +547,7 @@
(defn add-shape (defn add-shape
[data] [data]
(us/assert ::shape-attrs data) (us/assert ::shape-attrs data)
(let [id (uuid/random)] (let [id (uuid/next)]
(ptk/reify ::add-shape (ptk/reify ::add-shape
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -576,7 +576,7 @@
(defn add-canvas (defn add-canvas
[data] [data]
(us/assert ::shape-attrs data) (us/assert ::shape-attrs data)
(let [id (uuid/random)] (let [id (uuid/next)]
(ptk/reify ::add-canvas (ptk/reify ::add-canvas
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -600,7 +600,7 @@
(defn impl-duplicate-shape (defn impl-duplicate-shape
[state id] [state id]
(let [shape (get-in state [:workspace-data :shapes-by-id 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 (def duplicate-selected
(ptk/reify ::duplicate-selected (ptk/reify ::duplicate-selected

View file

@ -56,7 +56,7 @@
(def initial-state (def initial-state
{:route nil {:route nil
:router nil :router nil
:session-id (uuid/random) :session-id (uuid/next)
:auth (:auth storage) :auth (:auth storage)
:profile (:profile storage) :profile (:profile storage)
:clipboard #queue [] :clipboard #queue []

View file

@ -88,7 +88,7 @@
[type] [type]
(let [tool (seek #(= type (:type %)) minimal-shapes)] (let [tool (seek #(= type (:type %)) minimal-shapes)]
(assert tool "unexpected drawing tool") (assert tool "unexpected drawing tool")
(assoc tool :id (uuid/random)))) (assoc tool :id (uuid/next))))
(defn handle-drawing (defn handle-drawing
[type] [type]

View file

@ -19,7 +19,7 @@
(deftype WebWorker [stream wrk] (deftype WebWorker [stream wrk]
IWorker IWorker
(-ask [this message] (-ask [this message]
(let [sender (uuid/random) (let [sender (uuid/next)
data (assoc message :sender sender) data (assoc message :sender sender)
data (t/encode data)] data (t/encode data)]
(.postMessage wrk data) (.postMessage wrk data)
@ -28,7 +28,7 @@
(rx/take 1)))) (rx/take 1))))
(-send [this message] (-send [this message]
(let [sender (uuid/random) (let [sender (uuid/next)
data (assoc message :sender sender) data (assoc message :sender sender)
data (t/encode data)] data (t/encode data)]
(.postMessage wrk data) (.postMessage wrk data)

View file

@ -14,7 +14,7 @@
(enable-console-print!) (enable-console-print!)
(defonce id (uuid/random)) (defonce id (uuid/next))
(defn- on-message (defn- on-message
[event] [event]