diff --git a/addon/components/chat-window.js b/addon/components/chat-window.js index bf60b4f..f0cce28 100644 --- a/addon/components/chat-window.js +++ b/addon/components/chat-window.js @@ -50,15 +50,15 @@ export default class ChatWindowComponent extends Component { this.sender = this.getSenderFromParticipants(channel); // if not participant close window if (!this.sender) { - later( + return later( this, () => { this.chat.closeChannel(channel); }, 300 ); - return; } + this.listenChatChannel(channel); this.loadAvailableUsers.perform(); this.chat.on('chat.closed', this.handleChatClosed.bind(this)); @@ -73,6 +73,7 @@ export default class ChatWindowComponent extends Component { async listenChatChannel(chatChannelRecord) { this.socket.listen(`chat.${chatChannelRecord.public_id}`, (socketEvent) => { const { event, data } = socketEvent; + console.log(event); switch (event) { case 'chat.added_participant': case 'chat.removed_participant': @@ -140,6 +141,7 @@ export default class ChatWindowComponent extends Component { yield this.chat.sendMessage(this.channel, this.sender, this.pendingMessageContent, attachments); this.pendingMessageContent = ''; this.pendingAttachmentFiles = []; + this.handleChatFeedScroll(); } @action handleKeyPress(event) { @@ -233,7 +235,7 @@ export default class ChatWindowComponent extends Component { () => { this.channelFeedContainerElement.scrollTop = this.channelFeedContainerElement.scrollHeight; }, - 800 + 300 ); } } diff --git a/addon/components/layout/section/footer.hbs b/addon/components/layout/section/footer.hbs index 3c38857..f6c17de 100644 --- a/addon/components/layout/section/footer.hbs +++ b/addon/components/layout/section/footer.hbs @@ -1,3 +1,6 @@
\ No newline at end of file diff --git a/addon/components/layout/section/header.hbs b/addon/components/layout/section/header.hbs index 09dd0fe..f8c671b 100644 --- a/addon/components/layout/section/header.hbs +++ b/addon/components/layout/section/header.hbs @@ -1,28 +1,36 @@