0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

🐛 Fix invalid file amount after moving files

This commit is contained in:
Alejandro Alonso 2023-08-29 11:41:40 +02:00 committed by Andrey Antukh
parent 0aa361013a
commit 514ba6604b
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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 [_ _ _]