diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx index 6be7057a7e..61503c68a2 100644 --- a/webapp/actions/websocket_actions.jsx +++ b/webapp/actions/websocket_actions.jsx @@ -62,8 +62,10 @@ export function getStatuses() { } function handleReconnect() { - AsyncClient.getChannels(); - AsyncClient.getPosts(ChannelStore.getCurrentId()); + if (Client.teamId) { + AsyncClient.getChannels(); + AsyncClient.getPosts(ChannelStore.getCurrentId()); + } getStatuses(); ErrorStore.clearLastError(); ErrorStore.emitChange(); diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx index 88da513727..cf015bc842 100644 --- a/webapp/client/client.jsx +++ b/webapp/client/client.jsx @@ -40,7 +40,7 @@ export default class Client { } getTeamId() { - if (this.teamId === '') { + if (!this.teamId) { console.error('You are trying to use a route that requires a team_id, but you have not called setTeamId() in client.jsx'); // eslint-disable-line no-console }