From 534659cdc62c5dc993d14030929b6691d797d3d3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 10 Oct 2024 11:42:26 +0200 Subject: [PATCH] :bug: Fix flows import and export on zip format --- CHANGES.md | 1 + frontend/src/app/main/ui/shapes/export.cljs | 2 +- frontend/src/app/worker/import.cljs | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index bf855fb2e..ee6227421 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -35,6 +35,7 @@ - Fix problem with hover layers when hidden/blocked [Github #5074](https://github.com/penpot/penpot/issues/5074) - Fix problem with precision on boolean calculation [Taiga #8482](https://tree.taiga.io/project/penpot/issue/8482) - Fix problem when translating multiple path points [Github #4459](https://github.com/penpot/penpot/issues/4459) +- Fix problem on importing (and exporting) files with flows [Taiga #8914](https://tree.taiga.io/project/penpot/issue/8914) ## 2.2.1 diff --git a/frontend/src/app/main/ui/shapes/export.cljs b/frontend/src/app/main/ui/shapes/export.cljs index 9a8dce9d4..6671ccd48 100644 --- a/frontend/src/app/main/ui/shapes/export.cljs +++ b/frontend/src/app/main/ui/shapes/export.cljs @@ -173,7 +173,7 @@ (mf/defc export-flows [{:keys [flows]}] [:> "penpot:flows" #js {} - (for [{:keys [id name starting-frame]} flows] + (for [{:keys [id name starting-frame]} (vals flows)] [:> "penpot:flow" #js {:id id :name name :starting-frame starting-frame}])]) diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index cd6f11c8d..79e1e5f26 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -458,8 +458,10 @@ page-data (-> (parser/parse-page-data content) (assoc :name page-name) (assoc :id (resolve page-id))) + flows (->> (get page-data :flows) - (update-vals #(update % :starting-frame resolve)) + (map #(update % :starting-frame resolve)) + (d/index-by :id) (not-empty)) guides (-> (get page-data :guides)