0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-28 15:41:25 -05:00

🐛 Set correct project modified-at on moving files between projects

Happens when you use drag and drop on dashboard for moving files between
projects, but also if you use a context menu actions
This commit is contained in:
Andrey Antukh 2023-07-07 10:35:06 +02:00 committed by Alejandro Alonso
parent 7a837110f0
commit 3da0d85d8f
2 changed files with 9 additions and 3 deletions

View file

@ -53,6 +53,7 @@
- Fix problem with importation process [Taiga #5597](https://tree.taiga.io/project/penpot/issue/5597)
- Fix problem with HSV color picker [#3317](https://github.com/penpot/penpot/issues/3317)
- Fix problem with slashes in layers names for exporter [#3276](https://github.com/penpot/penpot/issues/3276)
- Fix incorrect modified data on moving files on dashboard [Taiga #5530](https://tree.taiga.io/project/penpot/issue/5530)
### :arrow_up: Deps updates

View file

@ -10,6 +10,7 @@
[app.common.data.macros :as dm]
[app.common.pages :as cp]
[app.common.schema :as sm]
[app.common.time :as dt]
[app.common.uri :as u]
[app.common.uuid :as uuid]
[app.config :as cf]
@ -872,10 +873,14 @@
ptk/UpdateEvent
(update [_ state]
(let [origin-project (get-in state [:dashboard-files (first ids) :project-id])]
(let [origin-project (get-in state [:dashboard-files (first ids) :project-id])
update-project (fn [project]
(-> project
(update :count #(+ % (count ids)))
(assoc :modified-at (dt/now))))]
(-> state
(d/update-in-when [:dashboard-projects origin-project] update :count #(- % (count ids)))
(d/update-in-when [:dashboard-projects project-id] update :count #(+ % (count ids))))))
(d/update-in-when [:dashboard-projects origin-project] update-project)
(d/update-in-when [:dashboard-projects project-id] update-project))))
ptk/WatchEvent
(watch [_ _ _]