Skip to content

Commit e933d21

Browse files
authored
Merge branch 'develop' into dewanshmobile/stuff
2 parents df7e3fc + 87742de commit e933d21

File tree

7 files changed

+6
-16
lines changed

7 files changed

+6
-16
lines changed

client/modules/User/components/Collection.jsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class Collection extends React.Component {
205205
if (
206206
this.props.user != null &&
207207
this.props.user.username &&
208-
this.props.collection.owner.username === this.props.user.username
208+
this.props.collection?.owner?.username === this.props.user.username
209209
) {
210210
isOwner = true;
211211
}
@@ -214,15 +214,15 @@ class Collection extends React.Component {
214214
}
215215

216216
hasCollection() {
217-
return !this.props.loading && this.props.collection != null;
217+
return !!this.props.collection;
218218
}
219219

220220
hasCollectionItems() {
221221
return this.hasCollection() && this.props.collection.items.length > 0;
222222
}
223223

224224
_renderLoader() {
225-
if (this.props.loading) return <Loader />;
225+
if (this.props.loading && !this.hasCollection()) return <Loader />;
226226
return null;
227227
}
228228

@@ -336,11 +336,7 @@ class Collection extends React.Component {
336336
}
337337

338338
_renderEmptyTable() {
339-
const isLoading = this.props.loading;
340-
const hasCollectionItems =
341-
this.props.collection != null && this.props.collection.items.length > 0;
342-
343-
if (!isLoading && !hasCollectionItems) {
339+
if (this.hasCollection() && !this.hasCollectionItems()) {
344340
return (
345341
<p className="collection-empty-message">
346342
{this.props.t('Collection.NoSketches')}
@@ -516,13 +512,7 @@ Collection.propTypes = {
516512

517513
Collection.defaultProps = {
518514
username: undefined,
519-
collection: {
520-
id: undefined,
521-
items: [],
522-
owner: {
523-
username: undefined
524-
}
525-
}
515+
collection: null
526516
};
527517

528518
function mapStateToProps(state, ownProps) {

client/routes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import createRedirectWithUsername from './components/createRedirectWithUsername'
2121
import MobileDashboardView from './modules/Mobile/MobileDashboardView';
2222
// import PrivacyPolicy from './modules/IDE/pages/PrivacyPolicy';
2323
// import TermsOfUse from './modules/IDE/pages/TermsOfUse';
24-
import Legal from './modules/IDE/pages/Legal';
24+
import Legal from './modules/Legal/pages/Legal';
2525
import { getUser } from './modules/User/actions';
2626
import {
2727
userIsAuthenticated,

0 commit comments

Comments
 (0)