Check if user logged in before making setActiveChannel request (#4097)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
60347559c7
Коммит
b640114edd
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user