Skip to content

Commit

Permalink
fix: sample app should not throw if user has no contacts
Browse files Browse the repository at this point in the history
see #16
  • Loading branch information
trampi committed Mar 12, 2020
1 parent 66a4cd5 commit eea771e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

<div>
<h2>Custom component for a chat session</h2>
<ng-container *ngIf="this.chatService.state$.getValue() === 'online'; else messagesComponentInformation">
<ng-container *ngIf="(this.chatService.state$ | async) === 'online' && (this.chatService.contactsSubscribed$ | async).length > 0; else messagesComponentInformation">
<ngx-chat-message-list [contact]="(this.chatService.contactsSubscribed$ | async)[0]"
[showAvatars]="true"></ngx-chat-message-list>
<ngx-chat-message-input [contact]="(this.chatService.contactsSubscribed$ | async)[0]"></ngx-chat-message-input>
Expand Down

0 comments on commit eea771e

Please sign in to comment.