@@ -55,6 +55,7 @@ import isNotificationsOpen from 'calypso/state/selectors/is-notifications-open';
5555import { ReaderPerformanceTrackerStop } from '../reader-performance-tracker' ;
5656import { CustomerCouncilBanner } from './customer-council-banner' ;
5757import EmptyContent from './empty' ;
58+ import { StreamError } from './error' ;
5859import PostLifecycle from './post-lifecycle' ;
5960import PostPlaceholder from './post-placeholder' ;
6061
@@ -166,6 +167,10 @@ class ReaderStream extends Component {
166167 } ) ;
167168 }
168169 }
170+ tryAgain = ( ) => {
171+ this . props . clearStream ( { streamKey : this . props . streamKey } ) ;
172+ this . fetchNextPage ( { } ) ;
173+ } ;
169174
170175 focusSelectedPost = ( selectedPostKey ) => {
171176 const postRefKey = this . getPostRef ( selectedPostKey ) ;
@@ -647,7 +652,7 @@ class ReaderStream extends Component {
647652 isRequesting = true ;
648653 }
649654
650- const hasNoPosts = this . isMounted && items . length === 0 && ! isRequesting ;
655+ const hasNoPosts = this . isMounted && items . length === 0 && ! isRequesting && ! this . props . error ;
651656
652657 const streamType = getStreamType ( streamKey ) ;
653658
@@ -753,6 +758,16 @@ class ReaderStream extends Component {
753758
754759 const TopLevel = this . props . isMain ? ReaderMain : 'div' ;
755760
761+ if ( this . props . error ) {
762+ body = (
763+ < StreamError
764+ onTryAgain = { this . tryAgain }
765+ streamKey = { streamKey }
766+ context = { this . state . selectedTab }
767+ />
768+ ) ;
769+ }
770+
756771 return (
757772 < TopLevel className = { baseClassnames } >
758773 < div ref = { this . overlayRef } className = "stream__init-overlay" />
@@ -812,6 +827,7 @@ export default connect(
812827 selectedPost,
813828 lastPage : stream . lastPage ,
814829 isRequesting : stream . isRequesting ,
830+ error : stream . error ,
815831 shouldRequestRecs : shouldRequestRecs ( state , streamKey , recsStreamKey ) ,
816832 likedPost : selectedPost && isLikedPost ( state , selectedPost . site_ID , selectedPost . ID ) ,
817833 organizations : getReaderOrganizations ( state ) ,
0 commit comments