Merge pull request #5037 from GabrielInTheWorld/alwaysTheSameTitle
Sets always the title 'Current LOS' if current LOS
This commit is contained in:
commit
534f2d1835
@ -164,10 +164,12 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
|
||||
if (this.isCurrentListOfSpeakers) {
|
||||
this.projectors = this.projectorRepo.getViewModelList();
|
||||
this.updateClosProjector();
|
||||
this.subscriptions.push(
|
||||
this.projectorRepo.getViewModelListObservable().subscribe(newProjectors => {
|
||||
this.projectors = newProjectors;
|
||||
this.updateClosProjector();
|
||||
});
|
||||
})
|
||||
);
|
||||
} else {
|
||||
const id = +this.route.snapshot.url[this.route.snapshot.url.length - 1].path;
|
||||
this.setListOfSpeakersId(id);
|
||||
@ -226,6 +228,7 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
|
||||
this.setListOfSpeakersId(listOfSpeakers.id);
|
||||
}
|
||||
});
|
||||
this.subscriptions.push(this.projectorSubscription);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -247,7 +250,10 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
|
||||
|
||||
this.closSubscription = this.listOfSpeakersRepo.getViewModelObservable(id).subscribe(listOfSpeakers => {
|
||||
if (listOfSpeakers) {
|
||||
super.setTitle(listOfSpeakers.getTitle() + ` - ${this.translate.instant('List of speakers')}`);
|
||||
const title = this.isCurrentListOfSpeakers
|
||||
? 'Current list of speakers'
|
||||
: listOfSpeakers.getTitle() + ` - ${this.translate.instant('List of speakers')}`;
|
||||
super.setTitle(title);
|
||||
this.viewListOfSpeakers = listOfSpeakers;
|
||||
const allSpeakers = this.viewListOfSpeakers.speakers.sort((a, b) => a.weight - b.weight);
|
||||
this.speakers = allSpeakers.filter(speaker => speaker.state === SpeakerState.WAITING);
|
||||
|
@ -24,7 +24,8 @@ export abstract class BaseViewComponent extends BaseComponent implements OnDestr
|
||||
protected subscriptions: Subscription[];
|
||||
|
||||
/**
|
||||
* Constructor for bas elist views
|
||||
* Constructor for base list views
|
||||
*
|
||||
* @param titleService the title serivce, passed to the base component
|
||||
* @param translate the translate service, passed to the base component
|
||||
* @param matSnackBar the snack bar service. Needed for showing errors.
|
||||
@ -96,13 +97,11 @@ export abstract class BaseViewComponent extends BaseComponent implements OnDestr
|
||||
* executes the life cycle again
|
||||
*/
|
||||
protected cleanSubjects(): void {
|
||||
if (this.subscriptions.length > 0) {
|
||||
for (const sub of this.subscriptions) {
|
||||
sub.unsubscribe();
|
||||
}
|
||||
this.subscriptions = [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate alternative avoid endless loops during change detection
|
||||
|
Loading…
Reference in New Issue
Block a user