Check if user logged in before making setActiveChannel request (#4097)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
60347559c7
Коммит
b640114edd
@@ -97,7 +97,9 @@ export default class NeedsTeam extends React.Component {
|
|||||||
|
|
||||||
$(window).on('blur', () => {
|
$(window).on('blur', () => {
|
||||||
window.isActive = false;
|
window.isActive = false;
|
||||||
AsyncClient.setActiveChannel('');
|
if (UserStore.getCurrentUser()) {
|
||||||
|
AsyncClient.setActiveChannel('');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Utils.applyTheme(this.state.theme);
|
Utils.applyTheme(this.state.theme);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import PostViewController from './post_view_controller.jsx';
|
import PostViewController from './post_view_controller.jsx';
|
||||||
|
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@@ -29,7 +30,9 @@ export default class PostViewCache extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
AsyncClient.setActiveChannel('');
|
if (UserStore.getCurrentUser()) {
|
||||||
|
AsyncClient.setActiveChannel('');
|
||||||
|
}
|
||||||
ChannelStore.removeChangeListener(this.onChannelChange);
|
ChannelStore.removeChangeListener(this.onChannelChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user