X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fchatrooms%2Fchatrooms.component.ts;h=99eb15acdc333be5174afda15c55f8ab20809274;hb=dd18c97daff609633700d4ba360d2f6f4440b7d6;hp=c965cf981bb7ce18bb3515fef254d8a73f9d8d97;hpb=53ae6990eb208b7631e46d95a4a65215e1b1b5ac;p=demos%2Fkafka%2Fchat diff --git a/src/app/chatrooms/chatrooms.component.ts b/src/app/chatrooms/chatrooms.component.ts index c965cf98..99eb15ac 100644 --- a/src/app/chatrooms/chatrooms.component.ts +++ b/src/app/chatrooms/chatrooms.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import { FormsModule } from '@angular/forms'; import { Chatroom } from '../chatroom'; +import { UserService } from "../user.service"; import { ChatroomService } from "../chatroom.service"; @Component({ @@ -12,11 +12,13 @@ export class ChatroomsComponent implements OnInit { chatrooms: Chatroom[] = []; - constructor(private chatroomsService: ChatroomService) { } + constructor( + private chatroomsService: ChatroomService, + private userService: UserService) {} ngOnInit(): void { - this.getChatrooms(); + this.userService.assertUserisKnown(() => this.getChatrooms()); } getChatrooms(): void {