Only get channels and posts on WebSocket connect if team is set (#3684)

This commit is contained in:
Joram Wilander
2016-07-27 09:53:49 -04:00
committed by Christopher Speller
parent f5375254f9
commit 199c55b566
2 changed files with 5 additions and 3 deletions

View File

@@ -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();

View File

@@ -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
}