File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,10 +238,16 @@ export default class AppStore extends Store {
238238 if ( this . timeSuspensionStart . add ( 10 , 'm' ) . isBefore ( moment ( ) ) ) {
239239 debug ( 'Reloading services, user info and features' ) ;
240240
241- setInterval ( ( ) => {
242- debug ( 'Reload app interval is starting' ) ;
241+ const reloadInterval = setInterval ( ( ) => {
242+ debug ( 'Reload app interval is starting, checking for internet connection ' ) ;
243243 if ( this . isOnline ) {
244- window . location . reload ( ) ;
244+ debug ( 'Clearing interval, invalidating stores' ) ;
245+ clearInterval ( reloadInterval ) ;
246+
247+ this . stores . user . getUserInfoRequest . invalidate ( { immediately : true } ) ;
248+ this . stores . services . allServicesRequest . invalidate ( { immediately : true } ) ;
249+ this . stores . features . defaultFeaturesRequest . invalidate ( { immediately : true } ) ;
250+ this . stores . features . featuresRequest . invalidate ( { immediately : true } ) ;
245251 }
246252 } , ms ( '2s' ) ) ;
247253 }
You can’t perform that action at this time.
0 commit comments