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:
parent
15a896e050
commit
a2ce5efe69
3 changed files with 3 additions and 2 deletions
|
@ -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})
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue