Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ export class VoteRepositoryService extends BaseMeetingRelatedRepository<ViewVote
}

const results: HasVotedResponse = await this.http.get(`${HAS_VOTED_URL}?ids=${ids.join()}`);
for (const pollId of Object.keys(results)) {
const subscription = this._subscribedPolls.get(+pollId);
const currentVal = subscription.current.value;
if (JSON.stringify(currentVal) !== JSON.stringify(results[pollId])) {
subscription.current.next(results[pollId]);
if (results) {
for (const pollId of Object.keys(results)) {
const subscription = this._subscribedPolls.get(+pollId);
const currentVal = subscription.current.value;
if (JSON.stringify(currentVal) !== JSON.stringify(results[pollId])) {
subscription.current.next(results[pollId]);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,6 @@ export class AccountButtonComponent extends BaseUiComponent implements OnInit {
} else {
stringForUserPresent = this.translate.instant(`Your account is not in this meeting.`);
}
return this.user.short_name + ': ' + stringForUserPresent;
return this.user?.short_name + ': ' + stringForUserPresent;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export class ParticipantDetailViewComponent extends BaseMeetingComponent {
public readonly groups: Observable<ViewGroup[]>;

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 {
Expand Down
8 changes: 4 additions & 4 deletions client/src/app/site/services/operator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class OperatorService {
}

public get onlyMeeting(): Id {
return this.user.onlyMeeting;
return this.user?.onlyMeeting;
}

public get canChangeOwnPassword(): boolean {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 (
Expand All @@ -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))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand Down
Loading