From d60209702b5cdc502742465a87074a43aa80fe28 Mon Sep 17 00:00:00 2001 From: Luis de Dios Date: Mon, 17 Aug 2026 19:53:54 +0200 Subject: [PATCH] :bug: Fix use loading message instead of placeholder when loading files --- frontend/src/app/main/ui/dashboard/files.cljs | 10 +++++++--- frontend/src/app/main/ui/dashboard/projects.cljs | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/ui/dashboard/files.cljs b/frontend/src/app/main/ui/dashboard/files.cljs index 49a1b57f37..cf2b4fce35 100644 --- a/frontend/src/app/main/ui/dashboard/files.cljs +++ b/frontend/src/app/main/ui/dashboard/files.cljs @@ -147,7 +147,6 @@ (sort-by :modified-at) (reverse))) - can-edit? (-> team :permissions :can-edit) project-id (:id project) is-draft-proyect (:is-default project) @@ -155,8 +154,13 @@ [rowref limit] (hooks/use-dynamic-grid-item-width) file-count (or (count files) 0) + + loading? (and (some? (:count project)) + (not= (:count project) file-count)) + empty-state-viewer (and (not can-edit?) - (= 0 file-count)) + (= 0 file-count) + (not loading?)) selected-files (mf/deref refs/selected-files) @@ -208,7 +212,7 @@ (tr "dashboard.empty-placeholder-drafts-subtitle") (tr "dashboard.empty-placeholder-files-subtitle"))}] [:> grid* {:project project - :files files + :files (if loading? nil files) :selected-files selected-files :can-edit can-edit? :origin :files diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 35b38e8b6a..441bf5cc5c 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -109,6 +109,10 @@ team-id (get team :id) file-count (or (:count project) 0) + + loading? (and (pos? (:count project)) + (empty? files)) + is-draft? (:is-default project) empty? (and (not can-edit) (= 0 file-count)) @@ -292,7 +296,7 @@ [:> line-grid* {:project project :team team - :files files + :files (if loading? nil files) :create-fn create-file :can-edit can-edit :limit limit