From a2ce5efe694eda921aee29910deda4f571699174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Thu, 30 Jan 2025 11:31:45 +0100 Subject: [PATCH] :sparkles: Add has-files prop to create-file event --- frontend/src/app/main/data/dashboard.cljs | 1 + frontend/src/app/main/ui/dashboard/files.cljs | 2 +- frontend/src/app/main/ui/dashboard/projects.cljs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index e66187bead..da5ccb8415 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -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}) diff --git a/frontend/src/app/main/ui/dashboard/files.cljs b/frontend/src/app/main/ui/dashboard/files.cljs index 019e7b5025..db3ac3d090 100644 --- a/frontend/src/app/main/ui/dashboard/files.cljs +++ b/frontend/src/app/main/ui/dashboard/files.cljs @@ -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 diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 611f205cf3..95a509f023 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -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