File tree Expand file tree Collapse file tree
x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import {
3939 getIsOnEndpointDetailsActivityLog ,
4040 getMetadataTransformStats ,
4141 isMetadataTransformStatsLoading ,
42- getActivityLogUninitialized ,
42+ getActivityLogIsUninitializedOrHasSubsequentAPIError ,
4343} from './selectors' ;
4444import {
4545 AgentIdsPendingActions ,
@@ -127,9 +127,7 @@ export const endpointMiddlewareFactory: ImmutableMiddlewareFactory<EndpointState
127127 action . type === 'userChangedUrl' &&
128128 hasSelectedEndpoint ( getState ( ) ) === true &&
129129 getIsOnEndpointDetailsActivityLog ( getState ( ) ) &&
130- ( getActivityLogUninitialized ( getState ( ) ) ||
131- ( ! ! getLastLoadedActivityLogData ( getState ( ) ) ?. data . length &&
132- ! getActivityLogError ( getState ( ) ) ) )
130+ getActivityLogIsUninitializedOrHasSubsequentAPIError ( getState ( ) )
133131 ) {
134132 await endpointDetailsActivityLogChangedMiddleware ( { store, coreStart } ) ;
135133 }
Original file line number Diff line number Diff line change @@ -419,6 +419,19 @@ export const getActivityLogError: (
419419 }
420420} ) ;
421421
422+ // returns a true if either lgo is uninitialised
423+ // or if it has failed an api call after having fetched a non empty log list earlier
424+ export const getActivityLogIsUninitializedOrHasSubsequentAPIError : (
425+ state : Immutable < EndpointState >
426+ ) => boolean = createSelector (
427+ getActivityLogUninitialized ,
428+ getLastLoadedActivityLogData ,
429+ getActivityLogError ,
430+ ( isUninitialized , lastLoadedLogData , isAPIError ) => {
431+ return isUninitialized || ( ! isAPIError && ! ! lastLoadedLogData ?. data . length ) ;
432+ }
433+ ) ;
434+
422435export const getIsEndpointHostIsolated = createSelector ( detailsData , ( details ) => {
423436 return ( details && isEndpointHostIsolated ( details ) ) || false ;
424437} ) ;
You can’t perform that action at this time.
0 commit comments