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

Этот коммит содержится в:
Joram Wilander
2016-07-27 09:53:49 -04:00
коммит произвёл Christopher Speller
родитель f5375254f9
Коммит 199c55b566
2 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@@ -62,8 +62,10 @@ export function getStatuses() {
} }
function handleReconnect() { function handleReconnect() {
AsyncClient.getChannels(); if (Client.teamId) {
AsyncClient.getPosts(ChannelStore.getCurrentId()); AsyncClient.getChannels();
AsyncClient.getPosts(ChannelStore.getCurrentId());
}
getStatuses(); getStatuses();
ErrorStore.clearLastError(); ErrorStore.clearLastError();
ErrorStore.emitChange(); ErrorStore.emitChange();

Просмотреть файл

@@ -40,7 +40,7 @@ export default class Client {
} }
getTeamId() { 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 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
} }