diff --git a/addon/components/chat-container.js b/addon/components/chat-container.js index 4530787..f81ecf3 100644 --- a/addon/components/chat-container.js +++ b/addon/components/chat-container.js @@ -3,4 +3,8 @@ import { inject as service } from '@ember/service'; export default class ChatContainerComponent extends Component { @service chat; + constructor() { + super(...arguments); + this.chat.restoreOpenedChats(); + } } diff --git a/addon/components/chat-tray.js b/addon/components/chat-tray.js index e3ab845..a82668f 100644 --- a/addon/components/chat-tray.js +++ b/addon/components/chat-tray.js @@ -29,6 +29,7 @@ export default class ChatTrayComponent extends Component { } @action removeChannel(chatChannelRecord) { + this.chat.closeChannel(chatChannelRecord); this.chat.deleteChatChannel(chatChannelRecord); this.reloadChannels(); } diff --git a/addon/components/chat-window.hbs b/addon/components/chat-window.hbs index 884853a..2b3b1fe 100644 --- a/addon/components/chat-window.hbs +++ b/addon/components/chat-window.hbs @@ -1,4 +1,4 @@ -
+
{{n-a this.channel.name "Untitled Chat"}} @@ -11,7 +11,7 @@
- +
{{user.name}}
@@ -39,31 +39,15 @@
{{/each}}
-
+
- {{#each this.channel.messages as |chatMessage|}} -
-
- {{this.sender.name}} -
{{chatMessage.sender.name}}
- - - -
-
-
- {{chatMessage.content}} -
-
{{chatMessage.createdAgo}}
-
-
- {{/each}} +
-
+