From 7a5e39f078c304b10073e7eefbc430d36153f966 Mon Sep 17 00:00:00 2001 From: slice Date: Mon, 16 Jul 2018 18:05:50 -0700 Subject: [PATCH] don't subscribe to channels if fetching stats fail --- priv/frontend/src/components/App.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/priv/frontend/src/components/App.js b/priv/frontend/src/components/App.js index 6f5dffa..e6aeb02 100644 --- a/priv/frontend/src/components/App.js +++ b/priv/frontend/src/components/App.js @@ -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}`], []