@@ -65,7 +65,8 @@ interface IPageLayoutState {
65
65
buildVersion ?: number ;
66
66
loadedBuildVersion ?: number ;
67
67
processId ?: number ;
68
- isServerConnected ?: boolean ;
68
+ isInternalApiConnected ?: boolean ;
69
+ isSocketIoServerConnected ?: boolean ;
69
70
isSidebarExpanded ?: boolean ;
70
71
thumbsHostname ?: string ;
71
72
thumbsPort ?: number ;
@@ -85,7 +86,8 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
85
86
buildVersion : null ,
86
87
loadedBuildVersion : null ,
87
88
processId : null ,
88
- isServerConnected : false ,
89
+ isInternalApiConnected : false ,
90
+ isSocketIoServerConnected : false ,
89
91
isSidebarExpanded : ! PreferencesManager . Instance . IsSidebarCollapsed ,
90
92
thumbsHostname : "" ,
91
93
thumbsPort : 80 ,
@@ -114,12 +116,17 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
114
116
}
115
117
116
118
public render ( ) {
117
- if ( ! this . state . isServerConnected ) {
119
+ if ( ! this . state . isInternalApiConnected ) {
118
120
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.
120
122
Will continue to retry the connection.</ Message > ) ;
121
123
}
122
124
125
+ if ( ! this . state . isSocketIoServerConnected ) {
126
+ return (
127
+ < Message style = { { margin : "20px" } } > Establishing connection...</ Message > ) ;
128
+ }
129
+
123
130
const width = this . state . isSidebarExpanded ? 199 : 79 ;
124
131
const icon = this . state . isSidebarExpanded ? "labeled" : true ;
125
132
@@ -221,10 +228,10 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
221
228
public onServiceConnectionStateChanged ( isConnected : boolean ) {
222
229
if ( isConnected ) {
223
230
this . _internalApi . start ( ) ;
224
- this . setState ( { isServerConnected : true } ) ;
231
+ this . setState ( { isSocketIoServerConnected : true } ) ;
225
232
} else {
226
233
this . _internalApi . kill ( ) ;
227
- this . setState ( { isServerConnected : false } ) ;
234
+ this . setState ( { isSocketIoServerConnected : false , isInternalApiConnected : false } ) ;
228
235
}
229
236
}
230
237
@@ -245,6 +252,8 @@ export class PageLayout extends React.Component<IPageLayoutProps, IPageLayoutSta
245
252
this . setState ( { loadedBuildVersion : message . buildVersion } ) ;
246
253
}
247
254
255
+ this . setState ( { isInternalApiConnected : true } ) ;
256
+
248
257
this . _realTimeApi . connect ( message . socketIoPortOffset ) . then ( ) ;
249
258
}
250
259
0 commit comments