mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 21:26:11 +02: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:
parent
7a837110f0
commit
3da0d85d8f
2 changed files with 9 additions and 3 deletions
|
@ -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 [_ _ _]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue