don't subscribe to channels if fetching stats fail

This commit is contained in:
Skip R. 2018-07-16 18:05:50 -07:00
parent 24e30a6e72
commit 7a5e39f078
No known key found for this signature in database
GPG key ID: 1508C19D7436A26D

View file

@ -25,7 +25,14 @@ export default class App extends Component {
}
subscribeToChannels () {
if (this.state.metrics == null) {
// fetching state failed, bail
log('not going to subscribe to realtime updates due to fetch failure')
return
}
const { graph } = this.state.metrics
const channels = Object.keys(graph).reduce(
(channels, name) => [...channels, `latency:${name}`, `status:${name}`],
[]