@@ -243,31 +243,36 @@ class DiscoverLanding extends AsyncComponent<Props, State> {
243
243
}
244
244
245
245
render ( ) {
246
+ let body ;
246
247
const { location, organization} = this . props ;
247
- const { loading, savedQueries, savedQueriesPageLinks} = this . state ;
248
+ const { loading, savedQueries, savedQueriesPageLinks, error} = this . state ;
249
+ if ( loading ) {
250
+ body = this . renderLoading ( ) ;
251
+ } else if ( error ) {
252
+ body = this . renderError ( ) ;
253
+ } else {
254
+ body = (
255
+ < PageContent >
256
+ < StyledPageHeader > { t ( 'Discover' ) } </ StyledPageHeader >
257
+ { this . renderBanner ( ) }
258
+ { this . renderActions ( ) }
259
+ < QueryList
260
+ pageLinks = { savedQueriesPageLinks }
261
+ savedQueries = { savedQueries }
262
+ savedQuerySearchQuery = { this . getSavedQuerySearchQuery ( ) }
263
+ location = { location }
264
+ organization = { organization }
265
+ onQueryChange = { this . handleQueryChange }
266
+ />
267
+ </ PageContent >
268
+ ) ;
269
+ }
248
270
249
271
return (
250
272
< SentryDocumentTitle title = { t ( 'Discover' ) } objSlug = { organization . slug } >
251
273
< React . Fragment >
252
274
< GlobalSelectionHeader organization = { organization } />
253
- < NoProjectMessage organization = { organization } >
254
- < PageContent >
255
- < StyledPageHeader > { t ( 'Discover' ) } </ StyledPageHeader >
256
- { this . renderBanner ( ) }
257
- { this . renderActions ( ) }
258
- { loading && this . renderLoading ( ) }
259
- { ! loading && (
260
- < QueryList
261
- pageLinks = { savedQueriesPageLinks }
262
- savedQueries = { savedQueries }
263
- savedQuerySearchQuery = { this . getSavedQuerySearchQuery ( ) }
264
- location = { location }
265
- organization = { organization }
266
- onQueryChange = { this . handleQueryChange }
267
- />
268
- ) }
269
- </ PageContent >
270
- </ NoProjectMessage >
275
+ < NoProjectMessage organization = { organization } > { body } </ NoProjectMessage >
271
276
</ React . Fragment >
272
277
</ SentryDocumentTitle >
273
278
) ;
0 commit comments