0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 00:40:30 -05:00

🐛 Fixes problem with remote changes

This commit is contained in:
alonso.torres 2021-02-10 18:30:44 +01:00 committed by Andrey Antukh
parent 70258e0eee
commit 648c088d02

View file

@ -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