commit before upgrade

This commit is contained in:
2021-12-27 13:31:17 +01:00
parent 04bec3ce6d
commit adbc663914
2 changed files with 13 additions and 4 deletions

View File

@@ -1,8 +1,14 @@
<ng-container *ngIf="!isLogged;else elseIfBlock">
<ng-container *ngIf="!isLogged;else elseIfNeedsInvitationBlock">
<p>Login for seeing the chat.</p>
</ng-container>
<ng-template #elseIfBlock>
<ng-template #elseIfNeedsInvitationBlock>
<ng-container *ngIf="needsInvitation | async;else elseIfNeedsToJoinBlock">
<p>This chat is private, you need to join the travel to see it.</p>
</ng-container>
</ng-template>
<ng-template #elseIfNeedsToJoinBlock>
<ng-container *ngIf="!isInRoom;else elseBlock">
<button mat-raised-button class="btn btn-default" (click)="join()">Join chat</button>
</ng-container>

View File

@@ -72,8 +72,11 @@ export class ChatComponent implements OnInit, AfterViewInit {
return this.chatService.isInRoom(this.roomId);
}
get isInvitedToRoom(): boolean {
return this.chatService.isInvitedToRoom(this.roomId);
get needsInvitation(): Promise<boolean> {
if (this.chatService.isInRoom(this.roomId)) { return new Promise(() => false); }
return this.chatService.roomNeedsInvitation(this.roomId);
}
get members(): RoomMember[] {