Bug fix preventing undesired recreation of poll-collection and poll-votes on poll change.

This commit is contained in:
Jochen Winzer 2020-11-04 09:38:53 +01:00
parent 866acfe7f5
commit 5ef1869a10
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<mat-card class="os-card" *ngFor="let poll of polls">
<mat-card class="os-card" *ngFor="let poll of polls; trackBy: identifyPoll">
<p class="subtitle-text">
<a [routerLink]="getPollDetailLink(poll)" [state]="{ back: 'true' }">{{ getPollVoteTitle(poll) }}</a>
</p>

View File

@ -53,6 +53,10 @@ export class PollCollectionComponent extends BaseViewComponentDirective implemen
);
}
public identifyPoll(index: number, poll: ViewBasePoll): number {
return poll.id;
}
public getPollVoteTitle(poll: ViewBasePoll): string {
const contentObject = poll.getContentObject();
const listTitle = contentObject.getListTitle();