diff --git a/src/app/components/home/new-landing/new-landing.component.html b/src/app/components/home/new-landing/new-landing.component.html index 0ef05f5c94f5b33a0cad526d00ba9de6d071337d..05795cd9e8cd72f79f24dc59e6e91aec956ecbd4 100644 --- a/src/app/components/home/new-landing/new-landing.component.html +++ b/src/app/components/home/new-landing/new-landing.component.html @@ -10,7 +10,7 @@ </button> </div> </form> - <button mat-button class="demo" color="primary">Demo Session<mat-icon color="accent">lightbulb_outline</mat-icon></button> + <button mat-button class="demo" color="primary" (click)="joinDemo()">Demo Session<mat-icon color="accent">lightbulb_outline</mat-icon></button> <button mat-fab class="fab-extended" color="accent" (click)="openCreateRoomDialog()"> <mat-icon class="add">add</mat-icon> Create Session diff --git a/src/app/components/home/new-landing/new-landing.component.ts b/src/app/components/home/new-landing/new-landing.component.ts index 35116f0dc67d30a6fea19a6f9458ce8bc23b5893..ed2468db50b8a7258fb916781d6cbe9545259783 100644 --- a/src/app/components/home/new-landing/new-landing.component.ts +++ b/src/app/components/home/new-landing/new-landing.component.ts @@ -14,6 +14,7 @@ import { Router } from '@angular/router'; export class NewLandingComponent implements OnInit { user: User; + demoId = 88992370; constructor(public authenticationService: AuthenticationService, private router: Router, @@ -30,6 +31,10 @@ export class NewLandingComponent implements OnInit { }); } + joinDemo() { + this.joinRoom(this.demoId); + } + joinRoom(id: number) { if (!this.user) { this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(loggedIn => { @@ -37,6 +42,8 @@ export class NewLandingComponent implements OnInit { this.router.navigate([`/participant/room/${id}`]); } }); + } else { + this.router.navigate([`/participant/room/${id}`]); } } } diff --git a/src/app/components/shared/room-join/room-join.component.ts b/src/app/components/shared/room-join/room-join.component.ts index e018ee7de467b7df33a414ce32c231e3be111b62..62c27ad940393b5d9bbbd8156c17abbfeebe48b3 100644 --- a/src/app/components/shared/room-join/room-join.component.ts +++ b/src/app/components/shared/room-join/room-join.component.ts @@ -24,7 +24,7 @@ export class JoinErrorStateMatcher implements ErrorStateMatcher { export class RoomJoinComponent implements OnInit { room: Room; - demoId = '26973546'; + demoId = '26973546'; // online 95680586, change before merging roomFormControl = new FormControl('', [Validators.required, Validators.minLength(8)]);