🐛 Enhancement on old thumbnail invalidation after sync

This commit is contained in:
Pablo Alba 2023-12-04 13:24:59 +01:00 committed by Andrés Moya
parent 3e965c96e7
commit fc1db9b985
2 changed files with 61 additions and 9 deletions

View file

@ -946,17 +946,16 @@
changes (pcb/concat-changes library-changes file-changes)
extract-shapes (fn [change]
(for [page-id [(:page-id change)]
id (:shapes change)]
(-> (get-in state [:workspace-data :pages-index page-id :objects id])
(assoc :page-id page-id))))
updated-copies (->> changes
find-heads (fn [change]
(->> (ch/heads-changed file change)
(map #(assoc %1 :page-id (:page-id change)))))
updated-copies (->> changes
:redo-changes
(filter #(= (:type %) :reg-objects))
(mapcat extract-shapes)
(filter ctk/instance-head?)
(mapcat find-heads)
distinct)]
(log/debug :msg "SYNC-FILE finished" :js/rchanges (log-changes