@@ -67,6 +67,7 @@ interface OwnProps {
6767 implicitSubmit ?: boolean
6868 children : ( r : QueriesState ) => JSX . Element
6969 check ?: Partial < Check >
70+ updateStatuses ?: ( statuses : StatusRow [ ] [ ] ) => void
7071}
7172
7273type ReduxProps = ConnectedProps < typeof connector >
@@ -114,9 +115,9 @@ class TimeSeries extends Component<Props, State> {
114115
115116 private pendingResults : Array < CancelBox < RunQueryResult > > = [ ]
116117 private pendingCheckStatuses : CancelBox < StatusRow [ ] [ ] > = null
117-
118118 public componentDidMount ( ) {
119119 const { cellID, setCellMount} = this . props
120+
120121 this . observer = new IntersectionObserver ( entries => {
121122 entries . forEach ( entry => {
122123 const { isIntersecting} = entry
@@ -156,6 +157,10 @@ class TimeSeries extends Component<Props, State> {
156157 if ( shouldReloadWhenVisible ) {
157158 this . pendingReload = true
158159 }
160+
161+ if ( this . props . updateStatuses ) {
162+ this . props . updateStatuses ( this . state . statuses )
163+ }
159164 }
160165
161166 public componentWillUnmount ( ) {
@@ -297,7 +302,6 @@ class TimeSeries extends Component<Props, State> {
297302 const giraffeResult = fromFlux ( files . join ( '\n\n' ) )
298303
299304 this . pendingReload = false
300-
301305 // this check prevents a memory leak https://github.com/influxdata/ui/issues/2137
302306 if ( ! this . isUnmounting ) {
303307 this . setState ( {
0 commit comments