Check if user logged in before making setActiveChannel request (#4097)

Этот коммит содержится в:
Joram Wilander
2016-09-28 08:43:22 -04:00
коммит произвёл Christopher Speller
родитель 60347559c7
Коммит b640114edd
2 изменённых файлов: 7 добавлений и 2 удалений

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

@@ -4,6 +4,7 @@
import PostViewController from './post_view_controller.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import UserStore from 'stores/user_store.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
import React from 'react';
@@ -29,7 +30,9 @@ export default class PostViewCache extends React.Component {
}
componentWillUnmount() {
AsyncClient.setActiveChannel('');
if (UserStore.getCurrentUser()) {
AsyncClient.setActiveChannel('');
}
ChannelStore.removeChangeListener(this.onChannelChange);
}