diff --git a/src/app/join-room/join-room.component.html b/src/app/join-room/join-room.component.html index 63ee40874c61db941b44b6f5dd0057a9f52bd7b9..d491d9e40da161bf67b0292fcc1647adf64d4feb 100644 --- a/src/app/join-room/join-room.component.html +++ b/src/app/join-room/join-room.component.html @@ -10,4 +10,5 @@ <mat-icon>send</mat-icon> </button> </div> + <button mat-button color="primary" (click)="joinDemo()">Join demo room <mat-icon>lightbulb_outline</mat-icon></button> </form> diff --git a/src/app/join-room/join-room.component.ts b/src/app/join-room/join-room.component.ts index 8f2aa11d135199fbffbf88418383974ab2af41a0..edb949a76da1108a94f47bd327360aee13695b3f 100644 --- a/src/app/join-room/join-room.component.ts +++ b/src/app/join-room/join-room.component.ts @@ -22,6 +22,7 @@ export class JoinErrorStateMatcher implements ErrorStateMatcher { export class JoinRoomComponent implements OnInit { room: Room; + demoId = '17703069'; roomFormControl = new FormControl('', [Validators.required]); @@ -36,18 +37,26 @@ export class JoinRoomComponent implements OnInit { ngOnInit() { } + getRoom(id: string): void { + this.roomService.getRoom(id) + .subscribe(room => { + this.room = room; + if (!room) { + this.notificationService.show(`No room was found with id: ${id}`); + } else { + this.router.navigate([`/participant/room/${this.room.shortId}`]); + } + }); + } + joinRoom(id: string): void { if (!this.roomFormControl.hasError('required')) { - this.roomService.getRoom(id) - .subscribe(room => { - this.room = room; - if (!room) { - this.notificationService.show(`No room was found with id: ${id}`); - } else { - this.router.navigate([`/participant/room/${this.room.shortId}`]); - } - }); + this.getRoom(id); } } + joinDemo(): void { + this.getRoom(this.demoId); + } + }