0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-07 15:39:42 -05:00

🐛 Fix file deletion exception

This commit is contained in:
Andrey Antukh 2024-12-23 12:40:40 +01:00
parent 8d74d82fd0
commit 2b31613853

View file

@ -361,7 +361,7 @@
;; --- EVENT: delete-file ;; --- EVENT: delete-file
(defn file-deleted (defn file-deleted
[_team-id project-id] [project-id]
(ptk/reify ::file-deleted (ptk/reify ::file-deleted
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
@ -378,10 +378,9 @@
(d/update-when :recent-files dissoc id))) (d/update-when :recent-files dissoc id)))
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ _ _]
(let [team-id (uuid/uuid (get-in state [:route :path-params :team-id]))] (->> (rp/cmd! :delete-file {:id id})
(->> (rp/cmd! :delete-file {:id id}) (rx/map (partial file-deleted project-id))))))
(rx/map #(file-deleted team-id project-id)))))))
;; --- Rename File ;; --- Rename File