From b68d721b3914307f27e25eaf0f06cf228712c075 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 25 Nov 2021 13:01:19 +0100 Subject: [PATCH] :bug: Fix problem when importing in shared libraries --- CHANGES.md | 1 + frontend/src/app/main/ui/dashboard/grid.cljs | 1 + frontend/src/app/main/ui/dashboard/libraries.cljs | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 40ae5df6a..0bb645fdd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Fix problems when exporting all artboards [Taiga #2234](https://tree.taiga.io/project/penpot/issue/2234). - Fix problems with team management [#1353](https://github.com/penpot/penpot/issues/1353) +- Fix problem when importing in shared libraries [#1362](https://github.com/penpot/penpot/issues/1362) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/ui/dashboard/grid.cljs b/frontend/src/app/main/ui/dashboard/grid.cljs index dc181f6e4..f158785e4 100644 --- a/frontend/src/app/main/ui/dashboard/grid.cljs +++ b/frontend/src/app/main/ui/dashboard/grid.cljs @@ -205,6 +205,7 @@ (mf/use-callback (fn [] (st/emit! (dd/fetch-files {:project-id project-id}) + (dd/fetch-shared-files) (dd/clear-selected-files)))) import-files (use-import-file project-id on-finish-import) diff --git a/frontend/src/app/main/ui/dashboard/libraries.cljs b/frontend/src/app/main/ui/dashboard/libraries.cljs index 98ff52fae..618855c2c 100644 --- a/frontend/src/app/main/ui/dashboard/libraries.cljs +++ b/frontend/src/app/main/ui/dashboard/libraries.cljs @@ -6,6 +6,7 @@ (ns app.main.ui.dashboard.libraries (:require + [app.common.data :as d] [app.main.data.dashboard :as dd] [app.main.refs :as refs] [app.main.store :as st] @@ -17,6 +18,8 @@ (mf/defc libraries-page [{:keys [team] :as props}] (let [files-map (mf/deref refs/dashboard-shared-files) + projects (mf/deref refs/dashboard-projects) + default-project (->> projects vals (d/seek :is-default)) files (->> (vals files-map) (sort-by :modified-at) (reverse))] @@ -38,5 +41,6 @@ [:div.dashboard-title [:h1 (tr "dashboard.libraries-title")]]] [:section.dashboard-container - [:& grid {:files files}]]])) + [:& grid {:files files + :project default-project}]]]))