From 5499eb6018988b595739191b25babd4631b9d762 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 17 Mar 2020 11:44:05 +0100 Subject: [PATCH] :bug: Fix wrong reference to page-id (cause of the race conditions). --- frontend/src/uxbox/main/data/workspace.cljs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 37dfb55cc6..beb6e3aa60 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -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