mirror of
https://github.com/penpot/penpot.git
synced 2025-02-23 15:26:29 -05:00
🐛 Fix Old thumbnail present after component sync
This commit is contained in:
parent
05a392d093
commit
20a86ad65a
1 changed files with 21 additions and 1 deletions
|
@ -944,7 +944,20 @@
|
|||
(when sync-typographies?
|
||||
(dwlh/generate-sync-file it file-id :typographies asset-id library-id state))])
|
||||
|
||||
changes (pcb/concat-changes library-changes file-changes)]
|
||||
changes (pcb/concat-changes library-changes file-changes)
|
||||
|
||||
find-shape (fn [data]
|
||||
(for [page-id [(:page-id data)]
|
||||
id (:shapes data)]
|
||||
(-> (get-in state [:workspace-data :pages-index page-id :objects id])
|
||||
(assoc :page-id page-id))))
|
||||
|
||||
updated-copies (->> changes
|
||||
:redo-changes
|
||||
(filter #(= (:type %) :reg-objects))
|
||||
(mapcat find-shape)
|
||||
(filter ctk/instance-head?)
|
||||
distinct)]
|
||||
|
||||
(log/debug :msg "SYNC-FILE finished" :js/rchanges (log-changes
|
||||
(:redo-changes changes)
|
||||
|
@ -955,6 +968,13 @@
|
|||
(when (seq (:redo-changes changes))
|
||||
(rx/of (dch/commit-changes (assoc changes ;; TODO a ver qué pasa con esto
|
||||
:file-id file-id))))
|
||||
(when-not (empty? updated-copies)
|
||||
(->> (rx/from updated-copies)
|
||||
(rx/mapcat (fn [shape]
|
||||
(rx/of
|
||||
(dwt/clear-thumbnail file-id (:page-id shape) (:id shape) "frame")
|
||||
(when-not (= (:frame-id shape) uuid/zero)
|
||||
(dwt/clear-thumbnail file-id (:page-id shape) (:frame-id shape) "frame")))))))
|
||||
(when (not= file-id library-id)
|
||||
;; When we have just updated the library file, give some time for the
|
||||
;; update to finish, before marking this file as synced.
|
||||
|
|
Loading…
Add table
Reference in a new issue