Streaming: Fixes an issue with time series panel and streaming data source when scrolling back from being out of view (#31431)

* Streaming: Fixes an issue with time series panel and streaming data source when scrolling back from being out of view

* Slight tweak
This commit is contained in:
Torkel Ödegaard 2021-02-24 11:12:11 +01:00 committed by GitHub
parent 070d512c57
commit 59c060f1f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,9 +136,12 @@ export class PanelChrome extends Component<Props, State> {
// So in this context we can only do a single call to setState
onDataUpdate(data: PanelData) {
if (!this.props.isInView) {
// Ignore events when not visible.
// The call will be repeated when the panel comes into view
this.setState({ refreshWhenInView: true });
if (data.state !== LoadingState.Streaming) {
// Ignore events when not visible.
// The call will be repeated when the panel comes into view
this.setState({ refreshWhenInView: true });
}
return;
}