Fix bug where "empty" view is shown when loading

This commit is contained in:
Andrew Nicolaou 2019-10-20 17:21:28 +02:00
parent 45dbb8ec8b
commit 36f305e2e7
1 changed files with 4 additions and 1 deletions

View File

@ -394,7 +394,10 @@ class Collection extends React.Component {
}
_renderEmptyTable() {
if (!this.hasCollectionItems()) {
const isLoading = this.props.loading;
const hasCollectionItems = this.props.collection != null && this.props.collection.items.length > 0;
if (!isLoading && !hasCollectionItems) {
return (<p className="sketches-table__empty">No sketches in collection</p>);
}
return null;