diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index 0dd540b5512737d7b302623f08c2381d4dfce340..1418a0ed34e201aa4bbcb8b08f10e69dc8d5f7b9 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -94,6 +94,7 @@ export class CommentListComponent implements OnInit, OnDestroy { this.authenticationService.watchUser.subscribe(newUser => { if (newUser) { this.user = newUser; + this.userRole = this.user.role; if (this.userRole === 0) { this.voteService.getByRoomIdAndUserID(this.roomId, this.user.id).subscribe(votes => { for (const v of votes) { @@ -103,7 +104,6 @@ export class CommentListComponent implements OnInit, OnDestroy { } } }); - this.userRole = this.route.snapshot.data.roles[0]; this.route.params.subscribe(params => { this.shortId = params['shortId']; this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(r => {