diff --git a/client/src/app/site/pages/meetings/pages/agenda/modules/list-of-speakers/components/list-of-speakers-main/list-of-speakers-main.component.ts b/client/src/app/site/pages/meetings/pages/agenda/modules/list-of-speakers/components/list-of-speakers-main/list-of-speakers-main.component.ts index b40a596c0f..293c4d9b48 100644 --- a/client/src/app/site/pages/meetings/pages/agenda/modules/list-of-speakers/components/list-of-speakers-main/list-of-speakers-main.component.ts +++ b/client/src/app/site/pages/meetings/pages/agenda/modules/list-of-speakers/components/list-of-speakers-main/list-of-speakers-main.component.ts @@ -20,24 +20,30 @@ export class ListOfSpeakersMainComponent extends BaseModelRequestHandlerComponen protected override onParamsChanged(params: any, oldParams: any): void { if (params[`id`] !== oldParams[`id`] || params[`meetingId`] !== oldParams[`meetingId`]) { - this.sequentialNumberMapping - .getIdBySequentialNumber({ - collection: ListOfSpeakers.COLLECTION, - meetingId: params[`meetingId`], - sequentialNumber: +params[`id`] - }) - .then(id => { - if (id && this._currentLOSId !== id) { - this._currentLOSId = id; - this.loadLOSDetail(); - } - }); + this.loadLOSDetail(+params[`id`], +params[`meetingId`]); } } - private loadLOSDetail(): void { - this.updateSubscribeTo(getListOfSpeakersDetailSubscriptionConfig(this._currentLOSId), { - hideWhenDestroyed: true - }); + protected override onShouldCreateModelRequests(params: any, meetingId: Id): void { + if (params[`id`] && meetingId) { + this.loadLOSDetail(+params[`id`], meetingId); + } + } + + private loadLOSDetail(id: Id, meetingId: Id): void { + this.sequentialNumberMapping + .getIdBySequentialNumber({ + collection: ListOfSpeakers.COLLECTION, + meetingId: meetingId, + sequentialNumber: id + }) + .then(id => { + if (id && this._currentLOSId !== id) { + this._currentLOSId = id; + this.updateSubscribeTo(getListOfSpeakersDetailSubscriptionConfig(this._currentLOSId), { + hideWhenDestroyed: true + }); + } + }); } } diff --git a/client/src/app/site/pages/meetings/pages/projectors/modules/fullscreen-projector/components/fullscreen-projector-main/fullscreen-projector-main.component.ts b/client/src/app/site/pages/meetings/pages/projectors/modules/fullscreen-projector/components/fullscreen-projector-main/fullscreen-projector-main.component.ts index f6339f6117..83aacfd3b3 100644 --- a/client/src/app/site/pages/meetings/pages/projectors/modules/fullscreen-projector/components/fullscreen-projector-main/fullscreen-projector-main.component.ts +++ b/client/src/app/site/pages/meetings/pages/projectors/modules/fullscreen-projector/components/fullscreen-projector-main/fullscreen-projector-main.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { Id } from 'src/app/domain/definitions/key-types'; import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component'; import { SequentialNumberMappingService } from 'src/app/site/pages/meetings/services/sequential-number-mapping.service'; @@ -15,17 +16,17 @@ export class FullscreenProjectorMainComponent extends BaseModelRequestHandlerCom super(); } - protected override onParamsChanged(params: any, _oldParams?: any): void { + protected override onShouldCreateModelRequests(params: any, meetingId: Id): void { if (params[`id`]) { this.sequentialNumberMappingService .getIdBySequentialNumber({ collection: ViewProjector.COLLECTION, - meetingId: params[`meetingId`], + meetingId, sequentialNumber: +params[`id`] }) .then(id => { if (id) { - this.subscribeTo(getProjectorSubscriptionConfig(id), { hideWhenMeetingChanged: true }); + this.subscribeTo(getProjectorSubscriptionConfig(id), { hideWhenDestroyed: true }); } }); } diff --git a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/components/committee-detail/committee-detail.component.ts b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/components/committee-detail/committee-detail.component.ts index f34ce30f79..3b671657b5 100644 --- a/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/components/committee-detail/committee-detail.component.ts +++ b/client/src/app/site/pages/organization/pages/committees/pages/committee-detail/components/committee-detail/committee-detail.component.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core'; -import { Id } from 'src/app/domain/definitions/key-types'; import { BaseModelRequestHandlerComponent } from 'src/app/site/base/base-model-request-handler.component/base-model-request-handler.component'; import { getCommitteeDetailSubscriptionConfig } from '../../../../committees.subscription'; @@ -10,12 +9,17 @@ import { getCommitteeDetailSubscriptionConfig } from '../../../../committees.sub styleUrls: [`./committee-detail.component.scss`] }) export class CommitteeDetailComponent extends BaseModelRequestHandlerComponent { - private committeeId: Id | null = null; - protected override onParamsChanged(params: any, oldParams: any): void { - if (params[`committeeId`] !== oldParams[`committeeId`]) { - this.committeeId = +params[`committeeId`] || null; - this.subscribeTo(getCommitteeDetailSubscriptionConfig(this.committeeId), { hideWhenDestroyed: true }); + if (params[`committeeId`] !== oldParams[`committeeId`] && +params[`committeeId`]) { + this.updateSubscribeTo(getCommitteeDetailSubscriptionConfig(+params[`committeeId`]), { + hideWhenDestroyed: true + }); + } + } + + protected override onShouldCreateModelRequests(params: any): void { + if (+params[`committeeId`]) { + this.subscribeTo(getCommitteeDetailSubscriptionConfig(+params[`committeeId`]), { hideWhenDestroyed: true }); } } }