mirror of
https://github.com/penpot/penpot.git
synced 2026-07-23 06:28:14 +00:00
📎 Add migration for cleaning unused props on file data.
This commit is contained in:
parent
7c98336148
commit
946309a485
@ -8,7 +8,7 @@
|
||||
(:require
|
||||
[app.common.uuid :as uuid]))
|
||||
|
||||
(def file-version 8)
|
||||
(def file-version 10)
|
||||
(def default-color "#b1b2b5") ;; $color-gray-20
|
||||
(def root uuid/zero)
|
||||
|
||||
|
||||
@ -234,7 +234,7 @@
|
||||
(:shapes shape))))))
|
||||
(map :id)))
|
||||
|
||||
(update-page [[page-id page]]
|
||||
(calculate-changes [[page-id page]]
|
||||
(let [objects (:objects page)
|
||||
eids (find-empty-groups objects)]
|
||||
|
||||
@ -245,7 +245,15 @@
|
||||
eids)))]
|
||||
|
||||
(loop [data data]
|
||||
(let [changes (mapcat update-page (:pages-index data))]
|
||||
(let [changes (mapcat calculate-changes (:pages-index data))]
|
||||
(if (seq changes)
|
||||
(recur (cp/process-changes data changes))
|
||||
data)))))
|
||||
|
||||
(defmethod migrate 10
|
||||
[data]
|
||||
(letfn [(update-page [_ page]
|
||||
(d/update-in-when page [:objects uuid/zero] dissoc :points :selrect))]
|
||||
(update data :pages-index #(d/mapm update-page %))))
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user