diff --git a/CHANGES.md b/CHANGES.md index 992e7bef8..b01df0fd2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,8 @@ - Remove change style on hover for options [Taiga #2172](https://tree.taiga.io/project/penpot/issue/2172) - Fix problem in viewer with dropdowns when comments active [#1303](https://github.com/penpot/penpot/issues/1303) - Add placeholder to create shareable link +- Fix project files count not refreshing correctly after import [Taiga #2216](https://tree.taiga.io/project/penpot/issue/2216) +- Remove button after import process finish [Taiga #2215](https://tree.taiga.io/project/penpot/issue/2215) ### :arrow_up: Deps updates ### :heart: Community contributions by (Thank you!) diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index e15b8d7fb..982e268f3 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -187,10 +187,12 @@ (ptk/reify ::files-fetched ptk/UpdateEvent (update [_ state] - (update state :dashboard-files - (fn [state] - (let [state (remove-project-files state)] - (reduce #(assoc %1 (:id %2) %2) state files)))))))) + (-> state + (update :dashboard-files + (fn [state] + (let [state (remove-project-files state)] + (reduce #(assoc %1 (:id %2) %2) state files)))) + (assoc-in [:dashboard-projects project-id :count] (count files))))))) (defn fetch-files [{:keys [project-id] :as params}] diff --git a/frontend/src/app/main/ui/dashboard/import.cljs b/frontend/src/app/main/ui/dashboard/import.cljs index 9d8083fc9..a07676364 100644 --- a/frontend/src/app/main/ui/dashboard/import.cljs +++ b/frontend/src/app/main/ui/dashboard/import.cljs @@ -331,10 +331,11 @@ [:div.modal-footer [:div.action-buttons - [:input.cancel-button - {:type "button" - :value (tr "labels.cancel") - :on-click handle-cancel}] + (when (or (= :analyzing (:status @state)) pending-import?) + [:input.cancel-button + {:type "button" + :value (tr "labels.cancel") + :on-click handle-cancel}]) (when (= :analyzing (:status @state)) [:input.accept-button diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index c171aab38..76da2bc5e 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -98,7 +98,8 @@ on-import (mf/use-callback (fn [] - (st/emit! (dd/fetch-recent-files) + (st/emit! (dd/fetch-files {:project-id (:id project)}) + (dd/fetch-recent-files) (dd/clear-selected-files))))] [:div.dashboard-project-row {:class (when first? "first")} diff --git a/frontend/src/app/main/ui/onboarding.cljs b/frontend/src/app/main/ui/onboarding.cljs index 77a103cdf..e3ff23b5b 100644 --- a/frontend/src/app/main/ui/onboarding.cljs +++ b/frontend/src/app/main/ui/onboarding.cljs @@ -356,7 +356,9 @@ on-finish-import (fn [] - (st/emit! (dd/fetch-recent-files))) + (st/emit! (dd/fetch-files {:project-id project-id}) + (dd/fetch-recent-files) + (dd/clear-selected-files))) open-import-modal (fn [file]