[deploy] Fix connect edge cases (#7352)

This commit is contained in:
Ben Halpern 2020-04-16 21:57:09 -04:00 committed by GitHub
parent 2d978696c4
commit 13537fb8d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -82,7 +82,9 @@ export default class Chat extends Component {
memberFilterQuery: null,
rerenderIfUnchangedCheck: null,
};
getAllMessages(chatOptions.activeChannelId, 0, this.receiveAllMessages);
if (chatOptions.activeChannelId) {
getAllMessages(chatOptions.activeChannelId, 0, this.receiveAllMessages);
}
}
componentDidMount() {

View file

@ -42,6 +42,9 @@ class UnopenedChannelNotice extends Component {
const number = document.getElementById('connect-number');
this.setState({ unopenedChannels });
if (unopenedChannels.length > 0) {
if (unopenedChannels[0].adjusted_slug === "@"+JSON.parse(window.currentUser).username) {
return;
}
number.classList.remove('hidden');
number.innerHTML = unopenedChannels.length;
document.getElementById('connect-link').href = '/connect/' + unopenedChannels[0].adjusted_slug;