0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-25 00:06:09 -05:00

🐛 Fix wrong reference to page-id (cause of the race conditions).

This commit is contained in:
Andrey Antukh 2020-03-17 11:44:05 +01:00 committed by Alonso Torres
parent fc734328cb
commit 5499eb6018

View file

@ -457,7 +457,7 @@
ptk/WatchEvent
(watch [_ state stream]
(let [session-id (:session-id state)
page (:workspace-page state)
page (get-in state [:pages page-id])
changes (->> changes
(mapcat identity)
(map #(assoc % :session-id session-id))
@ -1606,10 +1606,8 @@
(ptk/reify ::changes-commited
ptk/UpdateEvent
(update [_ state]
(let [page-id (::page-id state)
session-id (:session-id state)
(let [session-id (:session-id state)
state (-> state
(assoc-in [:workspace-page :revn] revn)
(assoc-in [:pages page-id :revn] revn))
changes (filter #(not= session-id (:session-id %)) changes)]
(-> state