Merge pull request #5673 from jwinzer/poll-collection-refresh

Bug fix preventing undesired recreation of poll-collection
This commit is contained in:
Sean 2020-11-04 16:23:51 +01:00 committed by GitHub
commit 6bc2c104b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();