From 27810c9df8bfc258734f092444ede7aa24bdd97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Wed, 13 May 2020 09:02:39 +0200 Subject: [PATCH] :sparkles: Do not show time for empty projects at dashboard --- .../src/uxbox/main/ui/dashboard/recent_files.cljs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs b/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs index 197c99bc6..7c30d5dd1 100644 --- a/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs @@ -52,17 +52,19 @@ (mf/defc recent-project [{:keys [project files first? locale] :as props}] (let [project-id (:id project) - team-id (:team-id project)] + team-id (:team-id project) + file-count (or (:file-count project) 0)] [:div.recent-files-row {:class-name (when first? "first")} [:div.recent-files-row-title [:h2.recent-files-row-title-name {:on-click #(st/emit! (rt/nav :dashboard-project {:team-id team-id :project-id project-id})) :style {:cursor "pointer"}} (:name project)] - [:span.recent-files-row-title-info (str (:file-count project) " files")] - (let [time (-> (:modified-at project) - (dt/timeago {:locale locale}))] - [:span.recent-files-row-title-info (str ", " time)])] + [:span.recent-files-row-title-info (str file-count " files")] + (when (> file-count 0) + (let [time (-> (:modified-at project) + (dt/timeago {:locale locale}))] + [:span.recent-files-row-title-info (str ", " time)]))] [:& grid {:id (:id project) :files files :hide-new? true}]]))