diff --git a/CHANGES.md b/CHANGES.md index 7d009faa5..273773cb1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ ### :bug: Bugs fixed - Fix unexpected output on get-page rpc method when invalid object-id is provided [Github #3546](https://github.com/penpot/penpot/issues/3546) +- Fix Invalid files amount after moving file from Project to Drafts [Taiga #5638](https://tree.taiga.io/project/penpot/us/5638) ## 1.19.1 diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index 7d0e4cce8..eb84a8e4d 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -891,13 +891,13 @@ ptk/UpdateEvent (update [_ state] (let [origin-project (get-in state [:dashboard-files (first ids) :project-id]) - update-project (fn [project delta] + update-project (fn [project delta op] (-> project - (update :count #(+ % (count ids))) + (update :count #(op % (count ids))) (assoc :modified-at (dt/plus (dt/now) {:milliseconds delta}))))] (-> state - (d/update-in-when [:dashboard-projects origin-project] update-project 0) - (d/update-in-when [:dashboard-projects project-id] update-project 10)))) + (d/update-in-when [:dashboard-projects origin-project] update-project 0 -) + (d/update-in-when [:dashboard-projects project-id] update-project 10 +)))) ptk/WatchEvent (watch [_ _ _]