Skip to content

Commit 338c986

Browse files
committed
Change navigation from dashboard and invite to prevent bug
1 parent 6783c0c commit 338c986

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

frontend/src/app/dashboard/dashboard.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h4 *ngIf="currentVideos.length==0" id="noVideosMessage">This room doesn't have
4343
<div *ngIf="this.moddedRooms!==undefined && this.moddedRooms.length>0">
4444
<h3 mat-subheader>MODDED ROOMS</h3>
4545
<mat-list-item *ngFor="let mod of this.moddedRooms">
46-
<a mat-line mat-stroked-button routerLink="{{mod.name}}">
46+
<a mat-line mat-stroked-button (click)="goToRoom(mod.name)">
4747
{{mod.name}}
4848
</a>
4949
<button mat-icon-button (click)="getInviteURL(mod.name,'moderator')">
@@ -64,7 +64,7 @@ <h3 mat-subheader>MODDED ROOMS</h3>
6464
<div *ngIf="this.presentedRooms!==undefined && this.presentedRooms.length>0">
6565
<h3 mat-subheader>PRESENTED ROOMS</h3>
6666
<mat-list-item *ngFor="let pres of this.presentedRooms">
67-
<a mat-line mat-stroked-button routerLink="{{pres.name}}">{{pres.name}}</a>
67+
<a mat-line mat-stroked-button (click)="goToRoom(pres.name)">{{pres.name}}</a>
6868
<button mat-icon-button (click)="openVideos(pres.name)" *ngIf="isRecordingEnabled">
6969
<mat-icon matTooltip="See recorded videos">video_library</mat-icon>
7070
</button>
@@ -74,7 +74,7 @@ <h3 mat-subheader>PRESENTED ROOMS</h3>
7474
<div *ngIf="this.participatedRooms!==undefined && this.participatedRooms.length>0">
7575
<h3 mat-subheader>PARTICIPATED ROOMS</h3>
7676
<mat-list-item *ngFor="let part of this.participatedRooms">
77-
<a mat-line mat-stroked-button routerLink="{{part.name}}">{{part.name}}</a>
77+
<a mat-line mat-stroked-button (click)="goToRoom(part.name)">{{part.name}}</a>
7878
<button mat-icon-button (click)="openVideos(part.name)" *ngIf="isRecordingEnabled">
7979
<mat-icon matTooltip="See recorded videos">video_library</mat-icon>
8080
</button>

frontend/src/app/dashboard/dashboard.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,10 @@ export class DashboardComponent implements OnInit {
129129
);
130130
this.newRoom;
131131
}
132+
133+
goToRoom(roomName: string) {
134+
this.router.navigate(['/', roomName]).then(() => {
135+
window.location.reload();
136+
});
137+
}
132138
}

frontend/src/app/invite/invite.component.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export class InviteComponent implements OnInit {
3737
this.loading = true;
3838
this.userName = this.userSrv.user.name;
3939
if(this.userSrv.isModOfRoom(this.roomName)) { //Direct access if already a mod
40-
this.router.navigate(['/',this.roomName]);
40+
this.navigate();
4141
} else {
4242
this.roomSrv.enterRoom(this.code).subscribe( //Update user if they are not in the room or mod
4343
user => {
4444
this.userSrv.saveUser(user);
45-
this.router.navigate(['/', this.roomName]);
45+
this.navigate();
4646
},
4747
error => {
4848
this.loading = false;
@@ -63,7 +63,7 @@ export class InviteComponent implements OnInit {
6363
user => {
6464
let auth = window.btoa(this.userName + ':' + this.password);
6565
this.userSrv.saveUser(user, auth);
66-
this.router.navigate(['/', this.roomName]);
66+
this.navigate();
6767
},
6868
error => {
6969
this.loading = false;
@@ -80,6 +80,12 @@ export class InviteComponent implements OnInit {
8080
}
8181
}
8282

83+
navigate() {
84+
this.router.navigate(['/', this.roomName]).then(() => {
85+
window.location.reload();
86+
});
87+
}
88+
8389
checkRoom() {
8490
this.roomSrv.checkRoom(this.code).subscribe(
8591
roomName => {

0 commit comments

Comments
 (0)