mirror of
https://github.com/penpot/penpot.git
synced 2026-08-18 18:58:40 +00:00
🐛 Fix use loading message instead of placeholder when loading files
This commit is contained in:
parent
1c650fe5a7
commit
37b80b296b
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user