diff --git a/client/src/app/gateways/repositories/polls/vote-repository.service/vote-repository.service.ts b/client/src/app/gateways/repositories/polls/vote-repository.service/vote-repository.service.ts index 34be35d030..e78cc4f13b 100644 --- a/client/src/app/gateways/repositories/polls/vote-repository.service/vote-repository.service.ts +++ b/client/src/app/gateways/repositories/polls/vote-repository.service/vote-repository.service.ts @@ -132,11 +132,13 @@ export class VoteRepositoryService extends BaseMeetingRelatedRepository; public get isMeetingAdminAndEditSelf(): boolean { - return this.operator.isMeetingAdmin && this.user.id === this.operator.user?.id; + return this.operator.isMeetingAdmin && this.user?.id === this.operator.user?.id; } public get showVoteWeight(): boolean { diff --git a/client/src/app/site/services/operator.service.ts b/client/src/app/site/services/operator.service.ts index 755a84d527..05c5cd5f3d 100644 --- a/client/src/app/site/services/operator.service.ts +++ b/client/src/app/site/services/operator.service.ts @@ -122,7 +122,7 @@ export class OperatorService { } public get onlyMeeting(): Id { - return this.user.onlyMeeting; + return this.user?.onlyMeeting; } public get canChangeOwnPassword(): boolean { @@ -411,7 +411,7 @@ export class OperatorService { public isInMeeting(meetingId: Id): boolean { const meeting = this.meetingRepo.getViewModel(meetingId); - return (meeting?.enable_anonymous && this.isAnonymous) || this.user.ensuredMeetingIds.includes(meetingId); + return (meeting?.enable_anonymous && this.isAnonymous) || this.user?.ensuredMeetingIds.includes(meetingId); } public hasCommitteeManagementRights(committee_id: number): boolean { @@ -643,7 +643,7 @@ export class OperatorService { ) { return true; } - const groups = this.user.groups(meetingId); + const groups = this.user?.groups(meetingId); if (!groups || !groups.length) { return false; } else if ( @@ -657,7 +657,7 @@ export class OperatorService { public isAllowedWithDelegation(...appliedSettings: DelegationSetting[]): boolean { return ( - !this.user.getMeetingUser(this.activeMeetingId)?.vote_delegated_to_id || + !this.user?.getMeetingUser(this.activeMeetingId)?.vote_delegated_to_id || !appliedSettings.some(appliedSetting => this.meetingSettings.instant(appliedSetting as keyof Settings)) ); } diff --git a/client/src/app/ui/modules/sidenav/modules/easter-egg/modules/chess-dialog/services/chess-challenge.service.ts b/client/src/app/ui/modules/sidenav/modules/easter-egg/modules/chess-dialog/services/chess-challenge.service.ts index 4813f85bfc..4a4400926e 100644 --- a/client/src/app/ui/modules/sidenav/modules/easter-egg/modules/chess-dialog/services/chess-challenge.service.ts +++ b/client/src/app/ui/modules/sidenav/modules/easter-egg/modules/chess-dialog/services/chess-challenge.service.ts @@ -3,7 +3,6 @@ import { MatDialog } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { NotifyResponse, NotifyService } from 'src/app/gateways/notify.service'; import { mediumDialogSettings } from 'src/app/infrastructure/utils/dialog-settings'; -import { OperatorService } from 'src/app/site/services/operator.service'; import { PromptService } from 'src/app/ui/modules/prompt-dialog'; import { ChessDialogModule } from '../chess-dialog.module'; @@ -14,7 +13,6 @@ import { ChessDialogModule } from '../chess-dialog.module'; export class ChessChallengeService { public constructor( private notifyService: NotifyService, - private op: OperatorService, private dialog: MatDialog, private translate: TranslateService, private prompt: PromptService