@@ -65,7 +65,8 @@ interface IPageLayoutState {
6565 buildVersion ?: number ;
6666 loadedBuildVersion ?: number ;
6767 processId ?: number ;
68- isServerConnected ?: boolean ;
68+ isInternalApiConnected ?: boolean ;
69+ isSocketIoServerConnected ?: boolean ;
6970 isSidebarExpanded ?: boolean ;
7071 thumbsHostname ?: string ;
7172 thumbsPort ?: number ;
@@ -85,7 +86,8 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
8586 buildVersion : null ,
8687 loadedBuildVersion : null ,
8788 processId : null ,
88- isServerConnected : false ,
89+ isInternalApiConnected : false ,
90+ isSocketIoServerConnected : false ,
8991 isSidebarExpanded : ! PreferencesManager . Instance . IsSidebarCollapsed ,
9092 thumbsHostname : "" ,
9193 thumbsPort : 80 ,
@@ -114,12 +116,17 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
114116 }
115117
116118 public render ( ) {
117- if ( ! this . state . isServerConnected ) {
119+ if ( ! this . state . isInternalApiConnected ) {
118120 return (
119- < Message warning style = { { margin : "20px" } } > The server is no longer responding. The service may be down.
121+ < Message warning style = { { margin : "20px" } } > The server is not responding. The service may be down.
120122 Will continue to retry the connection.</ Message > ) ;
121123 }
122124
125+ if ( ! this . state . isSocketIoServerConnected ) {
126+ return (
127+ < Message style = { { margin : "20px" } } > Establishing connection...</ Message > ) ;
128+ }
129+
123130 const width = this . state . isSidebarExpanded ? 199 : 79 ;
124131 const icon = this . state . isSidebarExpanded ? "labeled" : true ;
125132
@@ -221,10 +228,10 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
221228 public onServiceConnectionStateChanged ( isConnected : boolean ) {
222229 if ( isConnected ) {
223230 this . _internalApi . start ( ) ;
224- this . setState ( { isServerConnected : true } ) ;
231+ this . setState ( { isSocketIoServerConnected : true } ) ;
225232 } else {
226233 this . _internalApi . kill ( ) ;
227- this . setState ( { isServerConnected : false } ) ;
234+ this . setState ( { isSocketIoServerConnected : false , isInternalApiConnected : false } ) ;
228235 }
229236 }
230237
@@ -245,6 +252,8 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
245252 this . setState ( { loadedBuildVersion : message . buildVersion } ) ;
246253 }
247254
255+ this . setState ( { isInternalApiConnected : true } ) ;
256+
248257 this . _realTimeApi . connect ( message . socketIoPortOffset ) . then ( ) ;
249258 }
250259
0 commit comments