Fix connect runtime error (#7812)

This commit is contained in:
Ben Halpern 2020-05-13 08:09:24 -04:00 committed by GitHub
parent 3d313efbd6
commit f2f90e98b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -52,7 +52,6 @@ const Channels = ({
/>
);
});
console.log(channels);
let topNotice = '';
if (
expanded &&

View file

@ -205,7 +205,9 @@ export default class Chat extends Component {
messageOpened = () => {};
loadChannels = (channels, query) => {
const { activeChannelId, activeChannel } = this.state;
const { activeChannelId } = this.state;
const activeChannel = this.state.activeChannel ||
channels.filter((channel) => channel.chat_channel_id === activeChannelId)[0];
if (activeChannelId && query.length === 0) {
this.setState({
chatChannels: channels,
@ -1243,7 +1245,11 @@ export default class Chat extends Component {
chatChannels={state.chatChannels}
unopenedChannelIds={state.unopenedChannelIds}
handleSwitchChannel={this.handleSwitchChannel}
channelsLoaded={state.channelsLoaded}
filterQuery={state.filterQuery}
expanded={state.expanded}
currentUserId={state.currentUserId}
triggerActiveContent={this.triggerActiveContent}
/>
{notificationsState}
</div>