Merge pull request #159 from 6ea86b96/bug/error-message

Stop landing page content loading error from displaying all the time
This commit is contained in:
Jeremy Kauffman 2017-05-30 14:21:08 -04:00 committed by GitHub
commit db8201e43c

View file

@ -33,6 +33,10 @@ class DiscoverPage extends React.Component{
featuredUris, featuredUris,
fetchingFeaturedUris, fetchingFeaturedUris,
} = this.props } = this.props
const failedToLoad = !fetchingFeaturedUris && (
featuredUris === undefined ||
(featuredUris !== undefined && Object.keys(featuredUris).length === 0)
)
return ( return (
<main> <main>
@ -47,7 +51,7 @@ class DiscoverPage extends React.Component{
)) ))
} }
{ {
typeof featuredUris !== undefined && failedToLoad &&
<div className="empty">Failed to load landing content.</div> <div className="empty">Failed to load landing content.</div>
} }
</main> </main>