mirror of
https://github.com/penpot/penpot.git
synced 2026-08-27 07:09:14 +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)
|
(sort-by :modified-at)
|
||||||
(reverse)))
|
(reverse)))
|
||||||
|
|
||||||
|
|
||||||
can-edit? (-> team :permissions :can-edit)
|
can-edit? (-> team :permissions :can-edit)
|
||||||
project-id (:id project)
|
project-id (:id project)
|
||||||
is-draft-proyect (:is-default project)
|
is-draft-proyect (:is-default project)
|
||||||
@ -155,8 +154,13 @@
|
|||||||
[rowref limit] (hooks/use-dynamic-grid-item-width)
|
[rowref limit] (hooks/use-dynamic-grid-item-width)
|
||||||
|
|
||||||
file-count (or (count files) 0)
|
file-count (or (count files) 0)
|
||||||
|
|
||||||
|
loading? (and (some? (:count project))
|
||||||
|
(not= (:count project) file-count))
|
||||||
|
|
||||||
empty-state-viewer (and (not can-edit?)
|
empty-state-viewer (and (not can-edit?)
|
||||||
(= 0 file-count))
|
(= 0 file-count)
|
||||||
|
(not loading?))
|
||||||
|
|
||||||
selected-files (mf/deref refs/selected-files)
|
selected-files (mf/deref refs/selected-files)
|
||||||
|
|
||||||
@ -208,7 +212,7 @@
|
|||||||
(tr "dashboard.empty-placeholder-drafts-subtitle")
|
(tr "dashboard.empty-placeholder-drafts-subtitle")
|
||||||
(tr "dashboard.empty-placeholder-files-subtitle"))}]
|
(tr "dashboard.empty-placeholder-files-subtitle"))}]
|
||||||
[:> grid* {:project project
|
[:> grid* {:project project
|
||||||
:files files
|
:files (if loading? nil files)
|
||||||
:selected-files selected-files
|
:selected-files selected-files
|
||||||
:can-edit can-edit?
|
:can-edit can-edit?
|
||||||
:origin :files
|
:origin :files
|
||||||
|
|||||||
@ -109,6 +109,10 @@
|
|||||||
team-id (get team :id)
|
team-id (get team :id)
|
||||||
|
|
||||||
file-count (or (:count project) 0)
|
file-count (or (:count project) 0)
|
||||||
|
|
||||||
|
loading? (and (pos? (:count project))
|
||||||
|
(empty? files))
|
||||||
|
|
||||||
is-draft? (:is-default project)
|
is-draft? (:is-default project)
|
||||||
empty? (and (not can-edit)
|
empty? (and (not can-edit)
|
||||||
(= 0 file-count))
|
(= 0 file-count))
|
||||||
@ -292,7 +296,7 @@
|
|||||||
|
|
||||||
[:> line-grid* {:project project
|
[:> line-grid* {:project project
|
||||||
:team team
|
:team team
|
||||||
:files files
|
:files (if loading? nil files)
|
||||||
:create-fn create-file
|
:create-fn create-file
|
||||||
:can-edit can-edit
|
:can-edit can-edit
|
||||||
:limit limit
|
:limit limit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user