diff --git a/common/src/app/common/pages/common.cljc b/common/src/app/common/pages/common.cljc index cda7ad1a92..8a99ac3f3c 100644 --- a/common/src/app/common/pages/common.cljc +++ b/common/src/app/common/pages/common.cljc @@ -8,7 +8,7 @@ (:require [app.common.uuid :as uuid])) -(def file-version 10) +(def file-version 11) (def default-color "#b1b2b5") ;; $color-gray-20 (def root uuid/zero) diff --git a/common/src/app/common/pages/migrations.cljc b/common/src/app/common/pages/migrations.cljc index 1c3ab69ab1..61d8d87884 100644 --- a/common/src/app/common/pages/migrations.cljc +++ b/common/src/app/common/pages/migrations.cljc @@ -256,4 +256,15 @@ (d/update-in-when page [:objects uuid/zero] dissoc :points :selrect))] (update data :pages-index #(d/mapm update-page %)))) +(defmethod migrate 11 + [data] + (letfn [(update-object [objects id shape] + (if (= :frame (:type shape)) + (d/update-when shape :shapes (fn [shapes] + (filterv (fn [id] (contains? objects id)) shapes))) + shape)) + (update-page [id {:keys [objects] :as page}] + (d/mapm (partial update-object objects) objects))] + + (update data :pages-index #(d/mapm update-page %))))