X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fchatrooms%2Fchatrooms.component.ts;h=26665da7306dbf11249dc8d4612fa53a4406ba80;hb=a172837fe042e8acb3030df2d84cd39615cf5a11;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..26665da7 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({ @@ -8,15 +8,17 @@ import { ChatroomService } from "../chatroom.service"; templateUrl: './chatrooms.component.html', styleUrls: ['./chatrooms.component.less'] }) -export class ChatroomsComponent implements OnInit +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 {