0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-08 08:09:14 -05:00

Add has-files prop to create-file event

This commit is contained in:
Marina López 2025-01-30 11:31:45 +01:00 committed by GitHub
parent 15a896e050
commit a2ce5efe69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -953,6 +953,7 @@
(defn create-file
[{:keys [project-id name] :as params}]
(dm/assert! (uuid? project-id))
(ptk/reify ::create-file
ev/Event
(-data [_] {:project-id project-id})

View file

@ -160,7 +160,7 @@
(let [mdata {:on-success on-file-created}
params {:project-id (:id project)}]
(st/emit! (-> (dd/create-file (with-meta params mdata))
(with-meta {::ev/origin origin}))))))]
(with-meta {::ev/origin origin :has-files (> file-count 0)}))))))]
(mf/with-effect [project]
(when project

View file

@ -179,7 +179,7 @@
(let [mdata {:on-success on-file-created}
params {:project-id project-id}]
(st/emit! (-> (dd/create-file (with-meta params mdata))
(with-meta {::ev/origin origin}))))))
(with-meta {::ev/origin origin :has-files (> file-count 0)}))))))
on-create-click
(mf/use-fn