From 648c088d02c9a46e15081f7c09a63b5db2f68f2d Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 10 Feb 2021 18:30:44 +0100 Subject: [PATCH] :bug: Fixes problem with remote changes --- .../src/app/main/data/workspace/notifications.cljs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/notifications.cljs b/frontend/src/app/main/data/workspace/notifications.cljs index 5bb09a96a..effd20f97 100644 --- a/frontend/src/app/main/data/workspace/notifications.cljs +++ b/frontend/src/app/main/data/workspace/notifications.cljs @@ -200,13 +200,16 @@ (ptk/reify ::handle-file-change ptk/WatchEvent (watch [_ state stream] - (let [page-ids (into #{} (comp (map :page-id) - (filter identity)) - changes)] + (let [changes-by-pages (group-by :page-id changes) + process-page-changes + (fn [[page-id changes]] + (dwc/update-indices page-id changes))] + (rx/merge (rx/of (dwp/shapes-changes-persisted file-id msg)) - (when (seq page-ids) - (rx/from (map dwc/update-indices page-ids changes)))))))) + + (when-not (empty? changes-by-pages) + (rx/from (map process-page-changes changes-by-pages)))))))) (s/def ::library-change-event (s/keys :req-un [::type